saveuser.asp

来自「较完善的一个程序」· ASP 代码 · 共 53 行

ASP
53
字号
<!--#include file="conn.inc"-->
<%
   username=LCase(Request("username"))
   password=LCase(Request("newpin"))
   email=LCase(Request("email"))
   sex=LCase(Request("sex"))
   name=LCase(Request("name"))
   how_old=LCase(Request("how_old"))
   area=LCase(Request("area"))
   mobile=LCase(Request("mobile"))
   phone=LCase(Request("phone"))
   degree=LCase(Request("degree"))
   occupation=LCase(Request("occupation"))
   industry=LCase(Request("industry"))
   company=LCase(Request("company"))
   income=LCase(Request("income"))
   xinxi=LCase(Request("xinxi"))
   
   Set rs=Server.CreateObject("Adodb.RecordSet")
   rs.Open "Select * from user where username='"&username&"'",conn
   if not rs.EOF then
   response.write"<SCRIPT language=JavaScript>alert('该用户名已经存在!');"
   response.write"history.go(-1);</SCRIPT>" 
   'Response.Write "<font color=red><div align=center><br><br>该用户名已经存在</div></font>"
   Response.End   
   end if
   rs.close
   sql="select * from  user"
   rs.open sql,conn,1,3
   rs.addnew
   rs("username")=username
   rs("password")=password
   rs("email")=email
	 rs("name")=name
   rs("sex")=sex
   rs("how_old")=how_old
   rs("area")=area
   rs("mobile")=mobile
   rs("phone")=phone
   rs("degree")=degree
   rs("occupation")=occupation
   rs("industry")=industry
   rs("company")=company
   rs("income")=income
   rs("xinxi")=xinxi
   rs.update
   rs.Close
   set rs=Nothing
   conn.Close
   set conn=Nothing
   response.write"<SCRIPT language=JavaScript>alert('恭喜: 您已经注册完成!');"
   response.write"window.close();</SCRIPT>" 
%>

⌨️ 快捷键说明

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