跪求ASP编程高手。救救

来源:百度知道 编辑:UC知道 时间:2024/09/28 12:19:35
<%If Request.Form("action")="login" then
If ChkPost=false Then
Response.Write("<script language=JavaScript>alert('请不要重外部提交信息!');document.location.href='index.asp';</script>")
Response.End
End If
Dim UserName,UserPwd,Sql,Rs,IP
UserName=Trim(Request.Form("UserName"))
UserPwd=Trim(Request.Form("UserPwd"))
If UserName="" or UserPwd="" Then
Response.Write("<script language=JavaScript>alert('请输入您的用户名和密码!');document.location.href='javascript:window.history.go(-1);';</script>")
Response.End
End If
UserName=Checkstr(UserName)
UserPwd=Md5(UserPwd,32)

Sql="Select * From Users Where UserName='"&UserName&"' and UserPwd='"&UserPwd&"'"
Set Rs=server.CreateObject("adodb.recordset")
If Not IsObject(Conn) Then ConnectionDatabas

<%
'--------------------------------------ASP Code ------------------------Begin------------------
If Request.Form("action")="login" then '如果参数action为login值 则
If ChkPost=false Then '如果测试提交为 false (否) 则
Response.Write("<script language=JavaScript>alert('请不要重外部提交信息!');document.location.href='index.asp';</script>")
'输出错误信息并重定向到index.asp
Response.End '停止执行代码
End If

Dim UserName,UserPwd,Sql,Rs,IP '定义变量
UserName=Trim(Request.Form("UserName")) '变量赋值.注:Trim(字符串)函数功能为:去掉左右两边的空格 例如:ABC=' 1 2 3 'Trim(ABC) 值为 '1 2 3'(中间的空格去不掉)
UserPwd=Trim(Request.Form("UserPwd")) '变量赋值
If UserName="" or UserPwd="" Then 'UserName UserPwd 为空值 则
Response.Write("<script language=JavaScript>alert('请输入您的用户名和密码!');document.location.href='javascript:window.hi