asp用户登录验证源码示例
<p><HTML><br /><BODY><br /><TITLE><br />用户登录<br /></TITLE><br /><%<br />if Request.Form.Count=0 then<br />%><br />请输入用户名和密码<br /><FORM ACTION="login.asp" METHOD="post"><br /> <Table border=0><br /> <tr><td>用户名:</td><br /> <td><INPUT TYPE=text NAME=username VALUE=""></td><br /> </tr><br /> <tr><td>密码:</td><br /> <td><INPUT TYPE=password NAME=password VALUE=""></td><br /> </tr><br /> </Table><br /> <INPUT TYPE=Submit VALUE=确认提交><br /> <INPUT TYPE=reset VALUE=重新输入><br /></FORM></p><p><%else%><br /><%<br />Dim user<br />dim pwd<br />user=Request.Form("username")<br />pwd=Request.Form("password")</p><p>if user="fenfang" then<br /> if pwd="1234" then<br /> Response.write "用户登录成功"<br /> else <br /> Response.write "用户密码无效"<br /> end if<br />else<br /> Response.write "用户无效"<br />end if<br />end if<br />%></p><p>网页显示效果:<br />请输入用户名和密码 <table border=0><tbody><tr><td>用户名:</td><td><input name=username></td></tr><tr><td>密码:</td><td><input type=password name=password></td></tr></tbody></table><input type=submit value=确认提交> <input type=reset value=重新输入> </p><p>[此帖子已被 灰儿 在 2008-2-28 20:50:40 编辑过]
页:
[1]