📄 puton.asp
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="inc/conn.asp"-->
<!--#include file="inc/config.asp"-->
<%
'添加产品
If NOT IsEmpty (request("submit")) then
dim pdate
if request("date")<>"" then
pdate=trim(request("date"))
else
pdate=""
end if
set rs=server.CreateObject("adodb.recordset")
rs.Open "select * from book",conn,1,3
rs.AddNew
rs("pdate")=date
rs("press")=trim(request("press"))
rs("name")=trim(request("bookname"))
rs("author")=trim(request("author"))
rs("bookid")=trim(request("bookid"))
rs("isbn")=trim(request("isbn"))
rs("class")=trim(request("bookclass"))
rs("iflend")=0
if request("brief")<>"" then
rs("brief")=htmlencode2(request("brief"))
end if
rs.Update
rs.Close
set rs=nothing
call MsgBox("添加成功!","GoUrl","book.asp")
response.End
end if
%>
<html>
<head>
<style type="text/css">
<!--
body {
font-size:9pt;
}
td {font-size:9pt}
table{font-size:9pt}
.style1 {
font-family: "隶书";
font-weight: bold;
color: #FFBA75;
}
-->
</style>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<body>
<!--#include file="head.asp"-->
<table width="980" border="0" cellpadding="0" cellspacing="0" align="center">
<!--DWLayoutTable-->
<tr>
<td height="14" colspan="2" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="980" height="14"> </td>
</tr>
</table></td>
</tr>
<tr>
<td width="228" height="286" valign="top">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="71" height="66"><!--#include file="left1.htm"--></td>
</tr>
</table></td>
<td width="752" rowspan="2" valign="top">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td height="26" colspan="2" align="center" valign="top"><span class="style1"><font size="+2">图书数据录入</font></span></td>
<td width="104"></td>
</tr>
<tr>
<td width="157" height="12"> </td>
<td width="491"> </td>
<td></td>
</tr>
<tr>
<td height="236" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="160" height="236"> </td>
</tr>
</table></td>
<td rowspan="2" valign="top">
<table width="100%" border="0" cellpadding="0" cellspacing="0" >
<!--DWLayoutTable-->
<tr>
<td width="491" height="304" valign="top">
<form method="post" name="addbook" id="addbook" action="" >
<table border="0" >
<tr>
<td width="70">书 名:</td>
<td width="150"><input type="text" name="bookname" id="bookname" ></td>
</tr>
<tr>
<td height="10"></td>
</tr>
<tr>
<td width="70">作 者:</td>
<td width="150"><input type="text" name="author" id="author"></td>
</tr>
<tr>
<td height="10"></td>
</tr>
<tr>
<td width="70">出版社:</td>
<td width="150"><input type="text" name="press" id="press"></td>
</tr>
<tr>
<td height="10"></td>
</tr>
<tr>
<td width="70">图书编号:</td>
<td width="150"><input type="text" name="bookid" id="bookid"></td>
</tr>
<tr>
<td height="10"></td>
</tr>
<tr>
<td width="70">ISBN:</td>
<td width="150" bgcolor=""><input type="text" name="bookno" id="bookno"></td>
</tr>
<tr>
<td height="10"></td>
</tr>
<tr>
<td width="70">图书种类:</td>
<td width="150"><input type="text" name="bookclass" id="bookclass"></td>
</tr>
<tr>
<td height="10"></td>
</tr>
<tr>
<td width="70">简 介:</td>
<td width="150"><textarea name="brief" id="brief" cols="25" rows="5"></textarea></td>
</tr>
<tr>
<td></td>
<td><input type="submit" name="submit" value="提交" onClick="return checkpro()"> <input type="reset" name="reset" value="重写">
</td>
</tr>
</table>
</form></td>
</tr>
</table></td>
<td></td>
</tr>
<tr>
<td height="68"> </td>
<td></td>
</tr>
</table></td>
</tr>
<tr>
<td height="68"> </td>
</tr>
</table>
<!--#include file="foot.htm"-->
<script language="JavaScript">
<!--
function checkpro()
{
if(checkspace(document.addbook.bookname.value)) {
document.addbook.bookname.focus();
alert("请输入书名!");
return false;
}
if(checkspace(document.addbook.author.value)) {
document.addbook.author.focus();
alert("请输入作者!");
return false;
}
if(checkspace(document.addbook.bookno.value)) {
document.addbook.bookno.focus();
alert("请输入ISBN!");
return false;
}
if(checkspace(document.addbook.bookid.value)) {
document.addbook.bookid.focus();
alert("请输入图书编号!");
return false;
}
if(checkspace(document.addbook.bookclass.value)) {
document.addbook.bookclass.focus();
alert("请输入图书种类!");
return false;
}
if(checkspace(document.addbook.press.value)) {
document.addbook.press.focus();
alert("请输入出版社!");
return false;
}
return true;
}
function checkspace(checkstr) {
var str = '';
for(i = 0; i < checkstr.length; i++) {
str = str + ' ';
}
return (str == checkstr);
}
function regInput(obj, reg, inputStr)
{
var docSel = document.selection.createRange()
if (docSel.parentElement().tagName != "INPUT") return false
oSel = docSel.duplicate()
oSel.text = ""
var srcRange = obj.createTextRange()
oSel.setEndPoint("StartToStart", srcRange)
var str = oSel.text + inputStr + srcRange.text.substr(oSel.text.length)
return reg.test(str)
}
//-->
</script>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -