sqlstr =″’″&replace (data ,″’″,″’’″) &″’″
end function
function isn(data ,ddd)
end function
’将已保存的顾客填写的信息取出;
call isn(request (″name″) ,name)
call isn(request (″sfz″) ,sfz)
call isn(request (″tel″) ,tel)
call isn(request (″add″) ,add)
call isn(request (″post″) ,post)
call isn(request (″email″) ,email)
call isn(request (″hycode″) ,hycode)
sex = request (″sex″)
’用Connection 对象连接Access 数据库,调用函数从数据库中查询数据;
set conn = server. Create0bject (″adodb. connection″)
conn. 0pen″driver = {Microsoft Access Driver ( 3 . mdb) } ; dbq
=″&server. MapPath(″cai. mdb″)
sql =″insert into diancai (name ,tel ,add ,email ,sex ,ip ,hycode)
values(″
sql = sql & sqlstr (name) &″,″
sql = sql & sqlstr (tel) &″,″
sql = sql & sqlstr (add) &″,″
sql = sql & sqlstr (email) &″,″
sql = sql & sqlstr (sex) &″,″
sql = sql & sqlstr (ip) &″,″
sql = sql & sqlstr (hycode) &″)″
conn. Execute sql
session(″init″) = name
%〉
〈h2 align =″center″style =″COLOR : # 0000ff″〉〈IMG alt =″″
src =″. . / dengji. gif″〉〈/ h2〉
〈div align =″center″〉
〈A href =″diancai. asp″〉〈font color =″ff8800″〉【开始点菜】〈/
A〉
〈/ div〉
〈/ div style =″COLOR : # 800080″〉
’以下返回顾客的姓名、性别、电话、地址及e2mail ;
〈font color =″ff8800″〉〈% = name %〉
〈% = sex %〉〈br〉〈br〉
您的电话:
〈% = tel %〉〈br〉〈br〉
您的地址:
〈% = add %〉〈br〉〈br〉
您的e2mail :
〈% = email %〉〈br〉〈br〉
感谢合作! 我们会尽快和您取得联系! !
〈% = ti %〉〈/ div〉
3)管理员登录
4-2管理员登录界面
其部分代码如下:
<%
‘判断是否单击了[登录]按钮
if NOT isempty(request("LoginSubmit")) then
‘定义变量
dim admin,password
‘对输入的用户名和密码进行处理
password=md5(replace(trim(request("Pws")),"'",""))
‘初始化recordset对象
set rs=server.CreateObject("adodb.recordset")
‘查询数据库
rs.Open "select * from [admin] where admin='"&admin&"' and password='"&password&"' " ,conn,1,1
‘如果用户名存在,则继续判断密码是否正确
if not(rs.bof and rs.eof) then
if password=rs("password") then
session("admin")=trim(rs("admin"))
session("rank")=int(rs("rank"))
session.Timeout=sessionLife
rs.Close
set rs=nothing
response.Redirect "mpro.asp"
else
call MsgBox("登录失败!","Back","None")
end if
else
end if
end if
%>
上一页 [1] [2] [3] [4] [5] [6] [7] [8] 下一页