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

📄 savemodify.asp

📁 还是同学录 功能较为的简单点 挺好用的
💻 ASP
字号:
<!--#include file="conn.asp"-->
<!--#include file="error.asp"-->
<!--#include file="md5.asp"-->
<title><%=sitename%>-保存修改资料</title>
<%
  dim password,password1,newpwd,sex,birthday,email
  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 password<>password1 then
      founderr=true
      errinfo=errinfo&"<li>两次密码输入不一致<br>"
  elseif len(password)>20 then
      founderr=true
      errinfo=errinfo&"<li>密码只能在20个字符以内<br>"
  elseif password="" and password1="" then
      newpwd=""
  else
      newpwd=" password='"&md5(password)&"',"
  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("update user set "&newpwd&" sex='"&sex&"',birthday='"&birthday&"',email='"&email&"' where user='"&member&"'")
      success="<li>修改注册资料成功<br><li><a href='modify.asp'>重新修改注册资料</a><br><li><a href='main.asp'>返回"&sitename&"</a><br>"
      call successweb()
  end if

  conn.close
  set conn=nothing
%>

⌨️ 快捷键说明

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