📄 postuser.asp
字号:
<!-- #include file="auctionlib.asp" -->
<!--#include file="aspemail.inc"-->
<%
sUserName = Request.Form("username")
sName = Request.Form("name")
sEmail = Request.Form("email")
sAddressOne = Request.Form("addressone")
sAddressTwo = Request.Form("addresstwo")
sCity = Request.Form("city")
sState = Request.Form("state")
sZip = Request.Form("zip")
Call OpenDBConn
Call DoPageHeader
Response.Write("<FONT FACE=" & chr(34) & sFont & chr(34) & ">")
If Len(Trim(sUserName)) = 0 Then
sString = sString & "栏位""用户名"" 错误<BR>"
End If
If Len(Trim(sName)) = 0 Then
sString = sString & "栏位""您的名字"" 错误<BR>"
End If
If Len(Trim(sEmail)) = 0 Then
sString = sString & "栏位""电子邮件地址"" 错误<BR>"
End If
If Len(Trim(sAddressOne)) = 0 Then
sString = sString & "栏位""联络地址一"" 错误<BR>"
End If
If Len(Trim(sCity)) = 0 Then
sString = sString & "栏位""城市"" 错误<BR>"
End If
If sState = "other" Then
sString = sString & "栏位""省"" 错误<BR>"
End If
If Len(Trim(sZip)) = 0 Then
sString = sString & "栏位""邮政编号"" 错误<BR>"
End If
If sString <> "" Then
Response.Write ("<CENTER>" & sString & "请在浏览器中单击""<B>后退</B>"" 按钮再试一次</CENTER>")
Else
Call CheckName
End If
Call DoPageFooter
Sub CheckName
sSQl = ""
sSQL = sSQL & "SELECT COUNT(*) as Total FROM registration WHERE username = " & SQLStr(sUserName)
Set CountRS = GobjConnect.Execute(sSQL)
If CountRS.Fields("Total") > 0 Then
Response.Write("<CENTER>您选择的使用者名称:" & chr(34) & "<B>" & sUserName & "</B>" & chr(34) & "已经有人使用<BR>")
Response.Write("请在浏览器中单击""<B>后退</B>"" 按钮再试一次</CENTER>")
Else
Call InsertUser
End If
End Sub
Sub InsertUser
Randomize
sPassword = clng(rnd * 1000000) + 1000
npSQL = ""
npSQL = npSQL & " INSERT INTO Registration (username, password, Validated, Name, Email, Address1, Address2, City, State, Zip) "
npSQL = npSQL & " VALUES (" & SQLStr(sUserName) & ", "
npSQL = npSQL & SQLStr(sPassword) & " , "
If bUsersAdd = False Then
npSQL = npSQL & " false , "
Else
npSQL = npSQL & " true , "
End If
npSQL = npSQL & SQLStr(sName) & ", "
npSQL = npSQL & SQLStr(sEmail) & ", "
npSQL = npSQL & SQLStr(sAddressOne) & ", "
npSQL = npSQL & SQLStr(sAddressTwo) & ", "
npSQL = npSQL & SQLStr(sCity) & ", "
npSQL = npSQL & SQLStr(sState) & ", "
npSQL = npSQL & SQLStr(sZip) & " )"
GobjConnect.Execute(npSQL)
Response.Write("<CENTER>您已经成功注册成为会员<BR>")
Call SendPassEmail(sPassword)
Response.Write("您的会员密码已经使用电子邮件寄给您<BR>")
Response.Write("请单击首页的""改变密码""超级链接改变用户密码<BR>")
Response.Write("<A HREF=""default.asp"">单击这里</A>继续</CENTER>")
End Sub
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -