我哪里不对了各位高手为什么不行呢

xingairong 2003-10-16 04:03:13

<form name="form" method="post" action="">
管理员:
<input type="text" name="user">
密码:
<input type="password" name="pswd">
<input type="submit" name="Submit" value="提交">
</form>
<%
dim name,pass
name=trim(request.form("name"))
pass=trim(request.form("pswd"))
if name="111" & pass="222" then
response.redirect"disprec.asp"
response.end
else
response.Write("您不是管理员,请走开")

end if %>
...全文
31 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
xingairong 2003-10-17
  • 打赏
  • 举报
回复
谢谢,这里真好
zhaoliangpat 2003-10-16
  • 打赏
  • 举报
回复
最好分两页!

<form name="form1" method="post" action="yourpage.asp">
管理员:
<input type="text" name="user">
密码:
<input type="password" name="pswd">
<input type="submit" name="Submit" value="提交">
</form>



yourpage.asp



<%
dim name,pass
name=trim(request.form("name"))
pass=trim(request.form("pswd"))
if name="111" and pass="222" then
response.redirect "disprec.asp"
response.end
else
response.Write("您不是管理员,请走开")
end if %>
yzxlyd 2003-10-16
  • 打赏
  • 举报
回复
<%
if Request.Form.Count=0 then
%>

<FORM ACTION="login.asp" METHOD="post">
<Table border=0>
<tr><td>用户名:</td>
<td><INPUT TYPE=text NAME=username VALUE=""></td>
</tr>
<tr><td>密码:</td>
<td><INPUT TYPE=password NAME=password VALUE=""></td>
</tr>
</Table>
<INPUT TYPE=Submit VALUE=确认提交>
<INPUT TYPE=reset VALUE=重新输入>
</FORM>

<%else%>
<%
dim user
dim pwd
user=request.Form("username")
pwd=request.Form("password")
if user="yzxlyd" then
if pwd="52baby" then
response.Write"登陆成功"
else
response.Write"登陆失败"
end if
else
response.Write"无此用户"
end if
end if
%>
你用这个吧。
pp4u 2003-10-16
  • 打赏
  • 举报
回复
action="本页面的文件名"
ydr2002 2003-10-16
  • 打赏
  • 举报
回复
form的名字不要命名为“form”
slumcherry 2003-10-16
  • 打赏
  • 举报
回复
你是想name和pass一致时才导向吗? 如果时应该是并的关系, 用 and

28,390

社区成员

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

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