主题:  編寫一個酒店預訂網站遇到的問題。

vernon

职务:普通成员
等级:1
金币:1.0
发贴:172
#162002/2/27 23:52:00
tomorrow morning give you source



vernon

职务:普通成员
等级:1
金币:1.0
发贴:172
#172002/2/28 2:33:26
give you sample file now
i think it can help you more
www.macauweb.com/~vernon/sample2.html



文君

职务:普通成员
等级:1
金币:1.0
发贴:140
#182002/2/28 9:11:12
Thanks very much



vernon

职务:普通成员
等级:1
金币:1.0
发贴:172
#192002/2/28 9:13:40
You're welcome , 文君



文君

职务:普通成员
等级:1
金币:1.0
发贴:140
#202002/2/28 9:17:00
為了使這一貼子變得更精華,特將vernon寫的程序貼出來供大伙學習。有什麼不明白的快向VERNON請教。
testing.asp
<% @ LANGUAGE=VBScript CODEPAGE=936 %>

















<%
session("chk")="pass"
Set cnnDB = Server.CreateObject("ADODB.Connection")
strCon = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
         Server.MapPath("gbbook.mdb")
cnnDB.Open strCon
Set rstObj = Server.CreateObject ("ADODB.Recordset")
rstObj.Open "book", cnnDB
%>


<%
Do While Not rstObj.EOF
response.write ""
rstObj.MoveNext
Loop

rstObj.Close
Set rstObj = Nothing
cnnDB.Close
Set cnnDB = Nothing
%>

"
response.write rstObj("id")
response.write "
"
response.write rstObj("book")
response.write "
"
response.write rstObj("issue")
response.write "
"
response.write "assid(" & rstObj("id") &");return true>"
response.write "
"
response.write "assid('" & rstObj("book") &"');return true>"
response.write "
"
response.write "assid('" & rstObj("issue") &"');return true>"
response.write "
"
response.write "assall(" & rstObj("id") & ",'" & rstObj("book") & "','" & rstObj("issue") & "');return true>"
response.write "


show.asp
<%
chk=session("chk")
chkbtn=request("smit")
if ((chk<>"pass")or(chkbtn="")) then
response.redirect "testing.asp"
end if
%>











<%
id=request("bookid")
bn=request("bookname")
iss=request("issue")


if (chkbtn="ALL") then
%>
ID
Book NameISSUE

<%
response.write id
response.write "
"
response.write bn
response.write "
"
response.write iss
else
response.write chkbtn
response.write "
"
response.write id
end if

%>









vernon

职务:普通成员
等级:1
金币:1.0
发贴:172
#212002/2/28 9:21:24
我不知你有没有用它, 对你的网站和数据库都有一定的好处。
所以在我的例子中都用了 session , 使浏览不能直接输入 show.asp 去看结果, 一定要通过 testing.asp 进入方可。