关于用户登陆代码!

suguanyu 2004-11-21 09:38:40
我是一个菜鸟!
我想做一个登陆框。与SQL连接。请帮帮我。谢谢!!
...全文
113 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
zhouyouok 2004-11-21
  • 打赏
  • 举报
回复
<form action="check.asp" method="post">
<input type="text" name="username"><br>
<input type="password" name="password"><br>
<input type="submit" value="登 陆">
</form>
然后在check.asp判断
连接数据库
判断是否有用户名,如果有密码是否相等。
yjb136 2004-11-21
  • 打赏
  • 举报
回复
<!--#include file="conn.asp"-->
<!--#include file="ini/md5.asp"-->
<!--#include file="ini/fun.asp"-->
<% if (chkstr(Request.Form("name"))<>"" and chkstr(Request.Form("pwd"))<>"") then
Session("name")=chkstr(Request.Form("name"))
Session("pw")=md5(chkstr(Request.Form("pwd")),16)
set show=conn.execute("select userpass from gongsi where username='"&Session("name")&"'")
if (show.eof=true) then
Session("name")=""
Session("pw")=""
Response.Redirect("error.asp")
response.end
else
if Session("pw")=show("userpass") then
Response.Redirect("index.asp")
else
Response.Redirect("error.asp")
end if
end if
else
Response.Redirect("index.asp")
end if
%>

自己看吧
eduxh 2004-11-21
  • 打赏
  • 举报
回复
??
一个form一个text一个password,后台asp取到值和数据库比较,就这样,有是不明白的??

楼主还是说详细点吧

28,390

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧