⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 savereg.asp

📁 还是同学录 功能较为的简单点 挺好用的
💻 ASP
字号:
<!--#include file="conn.asp"-->
<!--#include file="error.asp"-->
<!--#include file="md5.asp"-->
<title><%=sitename%>-注册</title>
<%
  dim user,password,password1,sex,birthday,email
  user=lcase(trim(request.form("user")))
  password=request.form("password")
  password1=request.form("password1")
  sex=request.form("sex")
  birthday=request.form("birthday_y")&"-"&request.form("birthday_m")&"-"&request.form("birthday_d")
  email=trim(request.form("email"))
  if user="" then
      founderr=true
      errinfo="<li>帐号不能为空<br>"
  elseif len(user)>20 then
      founderr=true
      errinfo="<li>帐号只能在20个字符以内<br>"
  else
      set rs=conn.execute("select id from user where user='"&user&"'")
      if not (rs.eof and rs.bof) then
          founderr=true
          errinfo="<li>你所输入的帐号已被注册,请重新输入<br>"
      end if
      set rs=nothing
  end if
  if password="" or password1="" then
      founderr=true
      errinfo=errinfo&"<li>密码不能为空<br>"
  elseif password<>password1 then
      founderr=true
      errinfo=errinfo&"<li>两次密码输入不一致<br>"
  elseif len(password)>20 then
      founderr=true
      errinfo=errinfo&"<li>密码只能在20个字符以内<br>"
  end if
  if sex="" then
      founderr=true
      errinfo=errinfo&"<li>请选择你的性别<br>"
  end if

  if request.form("birthday_y")="" or request.form("birthday_m")="" or request.form("birthday_d")="" then
      founderr=true
      errinfo=errinfo&"<li>请选择你的生日<br>"
  else

      '判断生日日期
      select case request.form("birthday_m")
      case 4,6,9,11
          if request.form("birthday_d")>30 then
              founderr=true
              errinfo=errinfo&"<li>生日"&request.form("birthday_m")&"月是小月,该月没有31日<br>"
          end if
      case 2
          if request.form("birthday_y") mod 4=0 and request.form("birthday_d")>29 then
              founderr=true
              errinfo=errinfo&"<li>生日闰二月的最大日只能是29<br>"
          elseif request.form("birthday_y") mod 4<>0 and request.form("birthday_d")>28 then
              founderr=true
              errinfo=errinfo&"<li>生日非闰二月的最大日只能是28<br>"
          end if
      end select
  end if

  if email="" then
      founderr=true
      errinfo=errinfo&"<li>邮箱不能为空<br>"
  elseif instr(email,"@")=0 or instr(email,".")=0 then
      founderr=true
      errinfo=errinfo&"<li>你的邮箱输入有误<br>"
  elseif len(email)>50 then
      founderr=true
      errinfo=errinfo&"<li>邮箱只能在50个字符以内<br>"
  end if
  
  if founderr=true then
      call errweb()
  else
      conn.execute("insert into user(user,password,sex,birthday,email,regdate,logindate) values('"&user&"','"&md5(password)&"','"&sex&"','"&birthday&"','"&email&"',now(),now())")
      success="<li>你已经注册成功,帐号"&user&"<br><li><a href='login.asp'>登陆网络通讯录</a><br>"
      call successweb()
  end if

  conn.close
  set conn=nothing
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -