?? chaxun2.asp
字號:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%option explicit%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>查詢系統</title>
</head>
<%
dim act
act=request.form("act")
if act="ok" then
call qinshi()
response.end()
end if
sub qinshi()
dim qinshi
qinshi=request.form("qinshi")
qinshi=trim(qinshi)
if qinshi="" then
response.write "<font color='red'>請輸入寢室號碼!</font><a href='chaxun1.asp'>返回</a>"
response.end()
end if
qinshi=replace(qinshi,"'","")
qinshi=replace(qinshi,"=","")
dim connstr,conn,db
db="userinfo.mdb"
set conn=server.createobject("adodb.connection")
connstr="provider=microsoft.jet.oledb.4.0;data source="&server.mappath(db)
conn.open connstr
dim rs,sql
sql="select * from fangjian where qinshi='"&qinshi&"'"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
if rs.eof then
response.write("<font color='red'>對不起,找不到該寢室!</font>")
response.write("<input type='button' value='返回' onclick='window.history.back();'>")
response.end()
end if
response.write("查詢結果<hr size='1'>")
Do While Not rs.EOF
response.write("您的寢室:"&qinshi&"<br>")
response.write("您的學號:"&rs("xuehao")&"<br>")
response.write("您的床位:"&rs("chuangwei")&"<br>")
response.write("<br>")
rs.MoveNext
Loop
response.write("感謝您的查詢!<input type='button' value='返回' onclick='window.history.back();'>")
rs.close
set rs=nothing
conn.close
set conn=nothing
end sub
%>
<body>
寢室查詢
<p align="right"><a href="guanli.asp">返回</a>
<hr size="1">
請輸入您要查詢的寢室:
<form name="form1" method="post" action="chaxun2.asp">
<input name="qinshi" type="text" id="qinshi" maxlength="20">
<input type="submit" name="Submit" value="確定">
<input name="act" type="hidden" id="act" value="ok">
<br>
</form>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -