?? bookaddr.asp
字號(hào):
<%@LANGUAGE="VBSCRIPT"%>
<%option explicit
dim book,author,price,publish,num,photo,class1,memo
dim founderr,errmsg
founderr=false
book=request.form("book")
if book="" then
founderr=true
errmsg=errmsg &"★書(shū)名不能為空★"
end if
author=request.form("author")
if author="" then
founderr=true
errmsg=errmsg & "★作者不能為空★"
end if
price=request.form("price")
if price="" then
founderr=true
errmsg=errmsg & "★單價(jià)不能為空★"
end if
publish=request.form("publish")
if publish="" then
founderr=true
errmsg=errmsg & "★出版社不能為空★"
end if
num=request.form("num")
if num="" then
founderr=true
errmsg=errmsg & "★數(shù)量不能為空★"
end if
photo=request.form("photo")
if photo="" then
founderr=true
errmsg=errmsg & "★照片不能為空★"
end if
class1=request.form("class")
if class1="" then
founderr=true
errmsg=errmsg & "★類別不能為空★"
end if
memo=request.form("memo")
if memo="" then
founderr=true
errmsg=errmsg & "★備注不能為空★"
end if
if founderr then
response.write errmsg
%>
<html>
<head>
<style>
<!--
.font{color:navy;font-family:"宋體";font-size:12px;line-height:14px}
.3dfont{filter:glow(color=ffffff,strength=0) shadow(color=aaaaaa,direction=135);position:relative;
width:100%}
body {
background-color: #86BF78;
background-image: url();
}
-->
</style>
<meta name="generator" content="microsoft frongpage4.0">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"></head>
<body>
<p class="font">
<font face="arial">(</font>帶<font color="#ff0000"><strong><span
class="main2">*</span></strong></font><font
color="#000080">號(hào)為必填項(xiàng)<font face="aroal">)</font></font></samp>
<br>
<form method="post" action="">
<p><table width="398" border="1" align="center" cellpadding="1" cellspacing="1" bordercolor="#CC0000">
<tr>
<td class="font" width="112" align="center">添加書(shū)籍資料信息</td>
</tr>
<tr>
<td class="font" width="112" align="left"> 書(shū)名<font color="#ff0000"><strong><span
class="main2">*</span></strong></font></td>
<td width="273" align="left"><input type="text" name="book" size="20" value="<%=book%>"></td>
</tr>
<tr>
<td class="font" width="112" align="left">作者<font color="#ff0000"><strong><span
class="main2">*</span></strong></font></td>
<td width="273" align="left"><input type="text" name="author" size="20" value="<%=author%>"></td>
</tr>
<tr>
<td class="font" width="112" align="left">單價(jià)<font color="#ff0000"><strong><span
class="main2">*</span></strong></font></td>
<td width="273" align="left"><input type="text" name="price" size="20" value="<%=price%>"></td>
</tr><tr>
<td class="font" width="112" align="left">出版社<font color="#ff0000"><strong><span
class="main2">*</span></strong></font></td>
<td width="273" align="left"><input type="text" name="publish" size="20" value="<%=publish%>"></td>
</tr>
<tr>
<td class="font" width="112" align="left">數(shù)量<font color="#ff0000"><strong><span
class="main2">*</span></strong></font></td>
<td width="273" align="left"><input type="text" name="num" size="20" value="<%=num%>"></td></tr>
<tr>
<tr>
<td class="font" width="112" align="left">照片<font color="#ff0000"><strong><span
class="main2">*</span></strong></font></td>
<td width="273" align="left"><input type="text" name="photo" size="20" value="<%=photo%>"></td>
</tr>
<td class="font" width="112" align="left">類別<font color="#ff0000"><strong><span
class="main2">*</span></strong></font></td>
<td width="273" align="left"><input type="text" name="class" size="20" value="<%=class1%>"></td>
</tr>
<tr>
<td class="font" width="112" align="left">備注<font color="#ff0000"><strong><span
class="main2">*</span></strong></font></td>
<td width="273" align="left"><input type="text" name="memo" size="20" value="<%=memo%>"></td>
</tr>
</table>
<p align="center"><input type="submit" value="提交" name="b1"><input type="reset" value="全部重寫(xiě)" name="b2"></p>
</form>
</body>
</html>
<%else dim connstr,conn,rs,sql
connstr="dbq="+server.MapPath("mdb/bookshop.mdb")+";driver= {microsoft access driver (*.mdb)};"
set conn=server.CreateObject("adodb.connection")
conn.open connstr
set rs=server.CreateObject("adodb.recordset")
sql="select* from book"
rs.open sql,conn,3,3
rs.addnew
rs("book")=book
rs("author")=author
rs("price")=csng(price)
rs("publish")=publish
rs("num")=cint(num)
rs("photo")=photo
rs("class")=class1
rs("memo")=memo
rs.update
rs.close
conn.close
set conn=nothing
set rs=nothing
%>
<script language="javascript">
alert("已經(jīng)成功添加了一條記錄,!謝謝!")
document.location="bookright.asp"
</script>
<%end if %>
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -