asp完整显示数据代码

来源:互联网 发布:淘宝卖家版怎么登陆 编辑:程序博客网 时间:2024/05/29 14:05

asp显示数据的完整代码
此代码展示了从发送过来是数据,接收后判断数据库有没有此数据,然后写入session、cookie值,最后通过弹窗告诉用户登录成功,并跳转至指定页面

<%dim name,pwdname = request.form("name") //页面接收传过来的数据pwd = request.form("pwd")   //同上set rs = server.createobject("adodb.recordset")sql = "select * from [user] where [name]='"&&"' and [password]='"&md5(pwd)&"'"//rs.open sql,conn,1,1if rs.eof then  call close_rs     //sub程序,关闭实例化数据  call close_conn   //关闭数据库连接  call back("数据不存在!")else  //判断是不是管理员级别,如果是,写入session  if rs("level") = 10 then    session("bdkj") = rs("name")  end if  //写入cookie数据  response.cookies("bdkj")("user") = rs("name")  //sub程序,跳转到指定页面  call location("登录成功!","index.asp")end if%>
原创粉丝点击