论坛: 网站建设 标题: 帮帮看看这个ASP程序咯!!!看有没有问题??(谢!) 复制本贴地址    
作者: lzhlds [lzhlds]    论坛用户   登录
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>

<body>
<%
dim strname,passowrd,strmessage
strname=request.form("usernmae")
password=request.form("password")
response.write strname
response.write password
if strname<>"" and password<>"" then
if strname="guest" and password="guest" then
strmessage="欢迎进入此网页!<br>"
else
strmessage="禁止进入<br>"
end if
end if
%>
<center>
  <p>简单登录的表单的范例</p>
  <hr>
  <font color="red"><%=strmessage%></font>
  <form action="login.asp" method="post">
    <table width="32%" border="1">
      <tr>
        <td width="25%"><div align="center">用户名:</div></td>
        <td width="75%"><input name="strname" type="text" id="strname"  value="<%=strname%>"></td>
      </tr>
      <tr>
        <td><div align="center">密码:</div></td>
        <td><input name="password" type="password" id="password" value="<%=password%>"></td>
      </tr>
    </table>
    <p>
      <input type="submit" name="Submit" value="登录">

地主 发表时间: 09/12 19:09

回复: TomyXu [tomyxu]   论坛用户   登录
问题大大的多啊!
判断用户名和密码是否为空的语句写到输出用户名的语句的上边好一点吧!
如果是GUEST的话就输出
response.write "您现在是游客,欢迎访问!"

B1层 发表时间: 09/13 22:38

回复: hacker [xieyanzi]   论坛用户   登录
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>

<body>
<%
dim strname,passowrd,strmessage
strname=request.form("strname")
password=request.form("password")
response.write strname
response.write password
if strname<>"" and password<>"" then
if strname="guest" and password="guest" then
strmessage="欢迎进入此网页!<br>"
else
strmessage="禁止进入<br>"
end if
end if
%>
<center>
  <p>简单登录的表单的范例</p>
  <hr>
  <font color="red"><%=strmessage%></font>
  <form action="login.asp" method="post">
    <table width="32%" border="1">
      <tr>
        <td width="25%" align="center">用户名:</td>
        <td width="75%"><input name="strname" type="text" id="strname"  value="<%=strname%>"></td>
      </tr>
      <tr>
        <td><div align="center">密码:</div></td>
        <td><input name="password" type="password" id="password" value="<%=password%>"></td>
      </tr>
    </table>
    <p>
      <input type="submit" name="Submit" value="登录">
</form></center>

</body>
</html>
没什么大的语法错误,我改了一下
你看一下,可以不?

B2层 发表时间: 09/14 09:16

回复: TomyXu [tomyxu]   论坛用户   登录
还是判断用户名那个地方!这么写吧!
if name="" and password="" then
name="guest"
else if name="" and password<>"" then
response.write "请输入用户名"
else if name="" and password="" then
response.write "请输入密码"
else
set con=server.createobject("adodb.connection")
...........

继续写验证部分!能看懂吧??

B3层 发表时间: 09/14 13:55

论坛: 网站建设

20CN网络安全小组版权所有
Copyright © 2000-2010 20CN Security Group. All Rights Reserved.
论坛程序编写:NetDemon

粤ICP备05087286号