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

📄 usersave.asp

📁 A Design and Implementation of The Online Shopping System Abstract: Along with the development
💻 ASP
字号:
<!--#include file="../conndb.asp"-->
<html>
<head>
<title>保存用户信息</title>
</head>
<body>
<%
    Dim sql,uid
	Set rs = Server.CreateObject("ADODB.RECORDSET")
	If Request.Form("isadd")="new" Then
	  uid = Request("userid")
	  '判断此用户是否存在
	  Set rsUser = Conn.Execute("Select * from Users where UserId='" & uid & "'")
	  If Not rsUser.Eof Then
			%>
			<script language="javascript">
				alert("已经存在此用户名!");
				history.go(-1);
			</script>
			<%
	  Else
	    Set rsUser = Nothing
		 '在数据库表Users中插入新商品信息
    	sql = "Select * From Users"
	    rs.Open sql,conn,1,3

		rs.AddNew
		rs("UserId") = uid
		rs("UserName")= Request("username")
		rs("Sex") = Request("sex")
		rs("Pwd") = Request("pwd")
		rs("Address") = Request("address")
		rs("Telephone") = Request("telephone")
		rs("Mobile") = Request("mobile")
		rs("Email")= Request("email")
		rs.Update
	  End If
	Else
		'更新用户信息
	   uid = Request.QueryString("uid")
  	   sql = "Update Users Set UserName='"&Request("username")&"',Sex='"&Request("sex")&"'," &_
    	"Address='"&Request("address")&"',Telephone='"&Request("telephone")&"',Mobile='"&Request("mobile")&"',Email='"&Request("email")&"'" &_
   		" Where UserId='"&uid&"'"
   	   Conn.Execute(sql)
	End If

	Response.Write "<h2>用户信息已成功保存!</h2>"
%>
</body>
<script language="javascript">
	opener.location.reload();
	setTimeout("window.close()",800);
</script>
</html>

⌨️ 快捷键说明

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