| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 2368 人关注过本帖
标题:做的注册页面怎么不调用检查保存页面?
只看楼主 加入收藏
cilubutong
Rank: 1
等 级:新手上路
帖 子:119
专家分:2
注 册:2007-5-22
结帖率:75%
收藏
 问题点数:0 回复次数:23 
做的注册页面怎么不调用检查保存页面?
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
    %>

[[it] 本帖最后由 cilubutong 于 2008-11-27 11:47 编辑 [/it]]
搜索更多相关主题的帖子: 页面 保存 检查 注册 
2008-11-27 11:46
cilubutong
Rank: 1
等 级:新手上路
帖 子:119
专家分:2
注 册:2007-5-22
收藏
得分:0 
有哪个大哥知道的吗>?帮帮我!

全国最大的网上服装批发[url]www.[/url]
2008-11-27 12:06
hmhz
Rank: 7Rank: 7Rank: 7
等 级:贵宾
威 望:30
帖 子:1890
专家分:503
注 册:2006-12-17
收藏
得分:0 
<form name="form1" method="post" action="register.asp?action=usersave">
中的register.asp 改成 usersave.asp
查找问题需要去理解程序运行的逻辑去逐一找出问题所在!

[编程论坛] ASP超级群:49158383  敲门暗号:ASP编程
龍艺博客 http://www.
2008-11-27 12:27
cilubutong
Rank: 1
等 级:新手上路
帖 子:119
专家分:2
注 册:2007-5-22
收藏
得分:0 
以下是引用hmhz在2008-11-27 12:27的发言:


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

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

全国最大的网上服装批发[url]www.[/url]
2008-11-27 14:45
yms123
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:209
帖 子:12488
专家分:19042
注 册:2004-7-17
收藏
得分:0 
<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>
2008-11-27 15:10
cilubutong
Rank: 1
等 级:新手上路
帖 子:119
专家分:2
注 册:2007-5-22
收藏
得分:0 
以下是引用yms123在2008-11-27 15:10的发言:


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


 

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

全国最大的网上服装批发[url]www.[/url]
2008-11-27 15:41
chinasj
Rank: 2
等 级:论坛游民
威 望:1
帖 子:62
专家分:74
注 册:2008-4-26
收藏
得分:0 
<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
    %>
2008-11-27 16:46
cilubutong
Rank: 1
等 级:新手上路
帖 子:119
专家分:2
注 册:2007-5-22
收藏
得分:0 
回复 第7楼 chinasj 的帖子
大哥根据你的程序也不可以的啊!

全国最大的网上服装批发[url]www.[/url]
2008-11-27 18:28
yms123
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:209
帖 子:12488
专家分:19042
注 册:2004-7-17
收藏
得分:0 
以下是引用cilubutong在2008-11-27 15:41的发言:


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

有数据?
2008-11-27 19:37
cilubutong
Rank: 1
等 级:新手上路
帖 子:119
专家分:2
注 册:2007-5-22
收藏
得分:0 
回复 第9楼 yms123 的帖子
没有数据到数据库中

全国最大的网上服装批发[url]www.[/url]
2008-11-27 19:48
快速回复:做的注册页面怎么不调用检查保存页面?
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.017022 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved