找回密码
 注册
搜索
热搜: 回贴
  • 前程无忧官网首页 有什么好的平台可以
  • 最新的销售平台 互联网营销的平台有哪
  • 制作网页的基本流程 网页制作和网页设
  • 【帝国CMS】输出带序号的列表(数字排
  • 网站建设公司 三一,中联,极东泵车的
  • 织梦 建站 织梦网站模版后台怎么更改
  • 云服务官网 哪些网站有免费的简历模板
  • 如何建网站要什么条件 建网站要用什么
  • 吉林市移动公司电话 吉林省退休人员网
  • 设计类毕业论文 网站设计与实现毕业论
查看: 421|回复: 9

做的注册页面怎么不调用检查保存页面?

[复制链接]
发表于 2010-1-11 02:17:29 | 显示全部楼层 |阅读模式 IP:江苏扬州
register.asp 注册页面
<html>
<head>
<title>新用户注册----在线考试系统</title>
</head>
<body>
<form name="form1" method="post" action="register.asp?action=usersave">
  <!--#include file="conn.asp"-->
  <style type="text/css">
<!--
.STYLE5 {font-size: 12px}
-->
  </style>
  <table width="269" height="110" border="0" align="center">
    <tr>
      <td width="109" class="STYLE5 STYLE5">用户名:</td>
      <td width="150"><input name="nam" type="text" class="text" id="nam"></td>
    </tr>
    <tr>
      <td class="STYLE5">密码:</td>
      <td><input name="pwd" type="password" class="text" id="pwd"></td>
    </tr>
    <tr>
      <td class="STYLE4"><span class="STYLE5">请再次输入密码:</span></td>
      <td><input name="pwd1" type="password" class="text" id="pwd1"></td>
    </tr>
    <tr>
      <td colspan="2"><div align="center" class="STYLE1">
        <input name="Submit" type="submit" value="确认">
        <input type="submit" name="Submit2" value="返回">
      </div></td>
    </tr>
  </table>
</form>
</body>
</html>
usersave.asp页面
<!--#include file="conn.asp"-->
<%
   
  If Request("action") = "usersave" Then
        Call usersave()
     End If
  %>
<%
Sub usersave()
    dim nam
    dim pwd
    dim pwd1
    nam=trim(request.Form("nam"))
    pwd=trim(request.Form("pwd"))
    pwd1=trim(request.Form("pwd1"))
    if nam="" then
    response.Write"<script>alert('请输入用户名!');histroy.go(-1);</script>"
    response.End
    elseif pwd="" or pwd1=""then
    response.Write"<script>alert('请输入密码!');history.go(-1);</script>"
    response.End
    elseif pwd<>pwd1 then
    response.Write"<script>alert('两次输入的密码不一样!')history.go(-1);</script>"
    response.End
    elseif len(pwd)< 6 or len (pwd1)<6 then
    response.Write"<script>alert('密码不能少于6位')history.go(-1);</script>"
    response.End
    else
    set rs=server.CreateObject("ADODB.Recordset")
    sql="select * From student Where stuname='"&nam&"'"
    rs.open sql,conn,3,3
    if not rs.EOF then
    response.Write"<script>alert('该帐号已被注册')history.go(-1);</script>"
    response.End
    else
    rs.addnew
    rs("stuname")=nam
    rs("pwd")=pwd
    rs.update
    response.Redirect("index.asp")
    end if
    end if
    rs.close
    set rs=nothing
    conn.close
    set conn=nothing
    end sub
    %>
发表于 2010-1-11 02:17:33 | 显示全部楼层 IP:江苏扬州
<form name="form1" method="post" action="register.asp?action=usersave">
中的register.asp 改成 usersave.asp
查找问题需要去理解程序运行的逻辑去逐一找出问题所在!
回复

使用道具 举报

发表于 2010-1-11 02:17:39 | 显示全部楼层 IP:江苏扬州
以下是引用cilubutong在2008-11-27 15:41的发言:


我怎么点击那个确认它就不返回到注册页面,程序只执行到if nam="" then
    response.Write"alert('请输入用户名!');histroy.go(-1);"
    response.End
就不执行程序了

有数据?
回复

使用道具 举报

发表于 2010-1-11 02:17:43 | 显示全部楼层 IP:江苏扬州
以下是引用hmhz在2008-11-27 12:27的发言:


中的register.asp 改成 usersave.asp
查找问题需要去理解程序运行的逻辑去逐一找出问题所在!

照你的方法改了,但是还是不行,我的程序写的有错误吗?
回复

使用道具 举报

发表于 2010-1-11 02:17:47 | 显示全部楼层 IP:江苏扬州
以下是引用yms123在2008-11-27 15:10的发言:


  
  
   
      用户名:
      
   
   
      密码:
      
   
   
      请再次输入密码:
      
   
   
      
        
        
      
   
  




我怎么点击那个确认它就不返回到注册页面,程序只执行到if nam="" then
    response.Write"<script>alert('请输入用户名!');histroy.go(-1);</script>"
    response.End
就不执行程序了
回复

使用道具 举报

发表于 2010-1-11 02:17:51 | 显示全部楼层 IP:江苏扬州
<html>
<head>
<title>新用户注册----在线考试系统</title>
</head>
<body>
<form name="form1" method="post" action="?action=usersave">
  <!--#include file="conn.asp"-->
  <style type="text/css">
<!--
.STYLE5 {font-size: 12px}
-->
  </style>
  <table width="269" height="110" border="0" align="center">
    <tr>
      <td width="109" class="STYLE5 STYLE5">用户名:</td>
      <td width="150"><input name="nam" type="text" class="text" id="nam"></td>
    </tr>
    <tr>
      <td class="STYLE5">密码:</td>
      <td><input name="pwd" type="password" class="text" id="pwd"></td>
    </tr>
    <tr>
      <td class="STYLE4"><span class="STYLE5">请再次输入密码:</span></td>
      <td><input name="pwd1" type="password" class="text" id="pwd1"></td>
    </tr>
    <tr>
      <td colspan="2"><div align="center" class="STYLE1">
        <input name="Submit" type="submit" value="确认">
        <input type="submit" name="Submit2" value="返回">
      </div></td>
    </tr>
  </table>
</form>
</body>
</html>
usersave.asp页面
<!--#include file="conn.asp"-->
<%
   
  If Request("action") = "usersave" Then
        Call usersave()
     End If
  %>
<%
Sub usersave()
    dim nam
    dim pwd
    dim pwd1
    nam=trim(request.Form("nam"))
    pwd=trim(request.Form("pwd"))
    pwd1=trim(request.Form("pwd1"))
    if nam="" then
    response.Write"<script>alert('请输入用户名!');histroy.go(-1);</script>"
    response.End
    elseif pwd="" or pwd1=""then
    response.Write"<script>alert('请输入密码!');history.go(-1);</script>"
    response.End
    elseif pwd<>pwd1 then
    response.Write"<script>alert('两次输入的密码不一样!');history.go(-1);</script>"
    response.End
    elseif len(pwd)< 6 or len (pwd1)<6 then
    response.Write"<script>alert('密码不能少于6位');history.go(-1);</script>"
    response.End
    else
    set rs=server.CreateObject("ADODB.Recordset")
    sql="select * From student Where stuname='"&nam&"'"
    rs.open sql,conn,3,3
    if not rs.EOF then
    response.Write"<script>alert('该帐号已被注册')history.go(-1);</script>"
    response.End
    else
    rs.addnew
    rs("stuname")=nam
    rs("pwd")=pwd
    rs.update
    response.Redirect("index.asp")
    end if
    end if
    rs.close
    set rs=nothing
    conn.close
    set conn=nothing
    end sub
    %>
回复

使用道具 举报

发表于 2010-1-11 02:17:55 | 显示全部楼层 IP:江苏扬州
有哪个大哥知道的吗>?帮帮我!
回复

使用道具 举报

发表于 2010-1-11 02:17:59 | 显示全部楼层 IP:江苏扬州
没有数据到数据库中
回复

使用道具 举报

发表于 2010-1-11 02:18:03 | 显示全部楼层 IP:江苏扬州
<form name="form1" method="post" action="usersave.asp?action=usersave">
  </style>
  <table width="269" height="110" border="0" align="center">
    <tr>
      <td width="109" class="STYLE5 STYLE5">用户名:</td>
      <td width="150"><input name="nam" type="text" class="text" ></td>
    </tr>
    <tr>
      <td class="STYLE5">密码:</td>
      <td><input name="pwd" type="password" class="text" ></td>
    </tr>
    <tr>
      <td class="STYLE4"><span class="STYLE5">请再次输入密码:</span></td>
      <td><input name="pwd1" type="password" class="text" ></td>
    </tr>
    <tr>
      <td colspan="2"><div align="center" class="STYLE1">
        <input name="Submit" type="submit" value="确认">
        <input type="submit" name="Submit2" value="返回">
      </div></td>
    </tr>
  </table>
</form>
</body>
</html>
回复

使用道具 举报

发表于 2010-1-11 02:18:08 | 显示全部楼层 IP:江苏扬州
大哥根据你的程序也不可以的啊!
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|小黑屋|最新主题|手机版|微赢网络技术论坛 ( 苏ICP备08020429号 )

GMT+8, 2024-9-29 11:29 , Processed in 0.267468 second(s), 11 queries , Gzip On, MemCache On.

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表