请帮忙看一下那里有错

TT008 2003-11-01 11:50:48
pass.htm

<script>
var pass=window.prompt("请输入密码:","");
var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
xmlhttp.Open("post", "check.asp?pass="+pass, false);
xmlhttp.Send()
if(xmlhttp.responseText=="1")
window.location="进入.asp"
else{
alert('密码错误')
window.location="返回.asp"
}
</script>


check.asp
<%
dim pass
pass=Request.Form("pass")

if pass="123" then
Response.Write "1"
else
Response.Write "0"
end if
%>
我明明输入的是123
为何总是说我密码错误
...全文
53 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
itcoco 2003-11-01
  • 打赏
  • 举报
回复
加个trim()看看
应该是request("pass")吧
weiming28cn 2003-11-01
  • 打赏
  • 举报
回复
最好加上trim();
因为空格它也传上来哦!
DeltaCat 2003-11-01
  • 打赏
  • 举报
回复
还有你的 javascript的代码不规范,结尾的 ;都丢了
DeltaCat 2003-11-01
  • 打赏
  • 举报
回复
check.asp
<%
Response.ContentType = "text/xml"
dim pass
IF request.ServerVariables("REQUEST_METHOD")="POST" then
pass=Request.QueryString("pass")

if pass="123" then
Response.Write "1"
else
Response.Write "0"
end if
%>

28,391

社区成员

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

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