查询:
<%@ Language=VBScript %>
<% Response.ContentType="text/vnd.wap.wml" %>
<?xml version="1.0" encoding="gb2312"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<card title="WAP 电子银行">
<p>
欢迎来到WAP 电子银行 <br/>
请输入账户名查询: <input type="text" maxlength="10" />
<do type="accept" label="Check Bal">
<go href="checkuser.asp" method="post">
<postfield value="$accountno" />
</go>
</do>
</p>
</card>
</wml>
checkuser.asp
<%@ Language=VBScript %>
<% Response.ContentType="text/vnd.wap.wml" %>
<?xml version="1.0" encoding="gb2312"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<card title="WAP 电子银行">
<p>
<%
Set cn = Server.CreateObject("ADODB.Connection")
Set rs= Server.CreateObject("ADODB.RecordSet")
cn.Open "DRIVER={Microsoft Access Driver (*.mdb)};" & _
"DBQ="&Server.MapPath("bank.mdb")
txtSQL = "SELECT * FROM info WHERE &Request.Form("accountno")&"' "
rs.open txtSQL,cn,1,2
if rs.eof then
response.write "对不起!此用户名不存在!"
else
Response.Write "您好, " & rs.Fields("name") & "先生"
Response.Write "您的余额为¥" & rs.Fields("price")
%>
<%end if%>
</p>
</card>
</wml>
数据库结构:
bank 库
info 表
name price 字段