回 帖 发 新 帖 刷新版面

主题:大家帮我看看为什么注册时帐号和密码无法写入数据库呀

<!--#include file="conn.asp"-->
<!--#include file="webconfig.asp"-->
<%dim action
action=request.QueryString("action")%>
<html><head><title><%=webname%>--新用户注册</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="images/css.css" rel="stylesheet" type="text/css">
<script language=JavaScript>
function IsDigit()
{
  return ((event.keyCode >= 48) && (event.keyCode <= 57));
}
</script> 
<SCRIPT LANGUAGE="JavaScript">
<!--
function checkuserinfo()
{
   if(checkspace(document.userinfo.username.value)) {
    document.userinfo.username.focus();
    alert("对不起,请填写用户名!");
    return false;
  }
    if(checkspace(document.userinfo.userpassword.value) || document.userinfo.userpassword.value.length < 6 || document.userinfo.userpassword.value.length >20) {
    document.userinfo.userpassword.focus();
    alert("密码长度不能不能这空,在6位到20位之间,请重新输入!");
    return false;
  }
    if(document.userinfo.userpassword.value != document.userinfo.userpassword1.value) {
    document.userinfo.userpassword.focus();
    document.userinfo.userpassword.value = '';
    document.userinfo.userpassword1.value = '';
    alert("两次输入的密码不同,请重新输入!");
    return false;
  }

 if(document.userinfo.useremail.value.length!=0)
  {
    if (document.userinfo.useremail.value.charAt(0)=="." ||        
         document.userinfo.useremail.value.charAt(0)=="@"||       
         document.userinfo.useremail.value.indexOf('@', 0) == -1 || 
         document.userinfo.useremail.value.indexOf('.', 0) == -1 || 
         document.userinfo.useremail.value.lastIndexOf("@")==document.userinfo.useremail.value.length-1 || 
         document.userinfo.useremail.value.lastIndexOf(".")==document.userinfo.useremail.value.length-1)
     {
      alert("Email地址格式不正确!");
      document.userinfo.useremail.focus();
      return false;
      }
   }
 else
  {
   alert("Email不能为空!");
   document.userinfo.useremail.focus();
   return false;
   }
   if(checkspace(document.userinfo.quesion.value)) {
    document.userinfo.quesion.focus();
    alert("对不起,请填写密码提问!");
    return false;
  }
   if(checkspace(document.userinfo.answer.value)) {
    document.userinfo.answer.focus();
    alert("对不起,请填写密码提问的答案!");
    return false;
  }
   if(checkspace(document.userinfo.userzhenshiname.value)) {
    document.userinfo.userzhenshiname.focus();
    alert("对不起,请填写真实姓名!");
    return false;
  }
  if(checkspace(document.userinfo.shouhuodizhi.value)) {
    document.userinfo.shouhuodizhi.focus();
    alert("对不起,请填写收货人详细收货地址!");
    return false;
  }
  if(checkspace(document.userinfo.youbian.value)) {
    document.userinfo.youbian.focus();
    alert("对不起,请填写邮编!");
    return false;
  }
  if(document.userinfo.youbian.value.length!=6) {
    document.userinfo.youbian.focus();
    alert("对不起,请正确填写邮编!");
    return false;
  } 
    if(checkspace(document.userinfo.usertel.value)) {
    document.userinfo.usertel.focus();
    alert("对不起,请填写电话号码!");
    return false;
  } 
  
        if(checkspace(document.userinfo.songhuofangshi.value)) {
    document.userinfo.songhuofangshi.focus();
    alert("对不起,您还没有选择送货方式!");
    return false;
  }
      if(checkspace(document.userinfo.zhifufangshi.value)) {
    document.userinfo.zhifufangshi.focus();
    alert("对不起,您还没有选择支付方式!");
    return false;
  }
}

function checkspace(checkstr) {
  var str = '';
  for(i = 0; i < checkstr.length; i++) {
    str = str + ' ';
  }
  return (str == checkstr);
}
//-->
</script>

回复列表 (共2个回复)

沙发

没有看到你在什么地方往数据库中写入数据

板凳

只是表单验证。。。

我来回复

您尚未登录,请登录后再回复。点此登录或注册