用户登陆设置问题?急 。
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<body>
<form id="form1" name="form1" method="post" action="index.asp">
<p align="center">用户名字
<label>
<input name="username" type="text" id="username" />
</label>
</p>
<p align="center">用户密码
<label>
<input name="userpsw" type="text" id="userpsw" />
</label>
</p>
<p align="center">
<label>
<input type="reset" name="Submit2" value="清除" />
<input type="submit" name="Submit" value="登陆" />
</label>
</p>
</form>
</body>
</html>
就是这个东西想在这个页面写个/固定的密码验证的函数控制登陆index.asp
问题点数:100、回复次数:13Top
1 楼goga21cn()外城◣◥◣◥奔III的预备团员︻$▅▆▇◤()︻︼─一()回复于 2006-07-01 15:13:54 得分 0
沙发先Top
2 楼mumu1980()回复于 2006-07-01 15:16:48 得分 40
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<%action=request("action")
username=trim(request("username"))
userpwd=trim(request("userpwd))
if action=do then
if username="aa" and userpwd="123456" then
response.write("登陆成功!")
response.Redirect("index.asp")
else
response.write("用户名或密码错误!")
response.Redirect("登陆页")
end if
end if
%>
<body>
<form id="form1" name="form1" method="post" action="当前页名称?action=do">
<p align="center">用户名字
<label>
<input name="username" type="text" id="username" />
</label>
</p>
<p align="center">用户密码
<label>
<input name="userpsw" type="text" id="userpsw" />
</label>
</p>
<p align="center">
<label>
<input type="reset" name="Submit2" value="清除" />
<input type="submit" name="Submit" value="登陆" />
</label>
</p>
</form>
</body>
</html>Top
3 楼bbbpass()回复于 2006-07-01 15:16:55 得分 0
寒Top
4 楼bbbpass()回复于 2006-07-01 15:17:36 得分 0
我运行下能行结帖拉Top
5 楼bbbpass()回复于 2006-07-01 15:27:54 得分 0
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<%
action=request("action")
username=trim(request("username"))
userpwd=trim(request("userpwd"))
if action=do then
if username="aa" and userpwd="aa" then
response.write("登陆成功!")
response.Redirect("index.asp")
else
response.write("用户名或密码错误!")
response.Redirect("login.asp")
end if
end if
%>
<body>
<form id="form1" name="form1" method="post"action="login.asp?action=do">
<p align="center">用户名字
<label>
<input name="username" type="text" id="username" />
</label>
</p>
<p align="center">用户密码
<label>
<input name="userpsw" type="text" id="userpsw" />
</label>
</p>
<p align="center">
<label>
<input type="reset" name="Submit2" value="清除" />
<input type="submit" name="Submit" value="登陆" />
</label>
</p>
</form>
</body>
</html>
HTTP 错误 500.100 - 内部服务器错误 - ASP 错误
Internet 信息服务
--------------------------------------------------------------------------------
技术信息(用于支持人员)
错误类型:
Microsoft VBScript 编译器错误 (0x800A03EA)
语法错误
/shu/login.asp, line 12, column 10
if action=do then
---------^
浏览器类型:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)
网页:
GET /shu/login.asp
代码和错误。帮人帮到底 吧
Top
6 楼spook768(Prowriter)回复于 2006-07-01 15:34:57 得分 20
if action="do" thenTop
7 楼zhangjingcheng(ASP,JSP『学习者』)回复于 2006-07-01 15:53:55 得分 0
顶Top
8 楼zhangjingcheng(ASP,JSP『学习者』)回复于 2006-07-01 15:58:59 得分 20
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<%action=request("action")
username=trim(request("username"))
userpwd=trim(request("userpwd))
if request("action")="do" then
if username="aa" and userpwd="123456" then
response.write("登陆成功!")
response.Redirect("index.asp")
else
response.write("用户名或密码错误!")
response.Redirect("登陆页")
end if
end if
%>
<body>
<form id="form1" name="form1" method="post" action="?action=do">
<p align="center">用户名字
<label>
<input name="username" type="text" id="username" />
</label>
</p>
<p align="center">用户密码
<label>
<input name="userpsw" type="text" id="userpsw" />
</label>
</p>
<p align="center">
<label>
<input type="reset" name="Submit2" value="清除" />
<input type="submit" name="Submit" value="登陆" />
</label>
</p>
</form>
</body>
</html>
Top
9 楼zhangjingcheng(ASP,JSP『学习者』)回复于 2006-07-01 15:59:28 得分 0
这样就可以了啊Top
10 楼zys59(三仙半)回复于 2006-07-01 15:59:48 得分 0
这里节奏太快,刚看到,已经被解决了。
Top
11 楼zys59(三仙半)回复于 2006-07-01 16:08:52 得分 20
我测试了一下,就下面这句话改一下就行了。
userpwd=trim(request("userpwd)) 少了一个引号,改成
userpwd=trim(request("userpwd"))就可以了
Top
12 楼bbbpass()回复于 2006-07-01 16:21:15 得分 0
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<%
action=request("action")
username=trim(request("username"))
userpwd=trim(request("userpwd"))
if action="do" then
if username="aa" and userpwd="aa" then
response.write("登陆成功!")
response.Redirect("index.asp")
else
response.write("用户名或密码错误!")
response.Redirect("login.asp")
end if
end if
%>
<body>
<form id="form1" name="form1" method="post"action="?action=do">
<p align="center">用户名字
<label>
<input name="username" type="text" id="username" />
</label>
</p>
<p align="center">用户密码
<label>
<input name="userpsw" type="text" id="userpsw" />
</label>
</p>
<p align="center">
<label>
<input type="reset" name="Submit2" value="清除" />
<input type="submit" name="Submit" value="登陆" />
</label>
</p>
</form>
</body>
</html>
这个是最终的运行。但在 login.asp 登陆不到。index.asp
密码也没有什么反映!
解决解决。各位都辛苦了。 100分也不够分 啊。
<form id="form1" name="form1" method="post"action="?action=do"> 提交出现问题了。?还是匝地。Top
13 楼bbbpass()回复于 2006-07-01 16:22:33 得分 0
问题虽然小。可是咱们的认真对待吧。Top




