?? savereg.asp
字號:
<!--#include file="inc/adovbs.asp"-->
<!--#include file="inc/Conn.asp"-->
<!--#include file="inc/MD5.asp"-->
<!--#include file="inc/SQLCHK.asp"-->
<%
Dim UserNameR, PasswordR, QuestionR, AnswerR, RealNameR, SexR, BirthdayR
Dim IDCardR, EmailR, LinkMethodR, AddressR, MedHistoryR, MedRecordR, OtherInfoR
UserNameR = Request.Form("UserName")
PasswordR = MD5(Request.Form("Password"))
QuestionR = Request.Form("Question")
AnswerR = Request.Form("Answer")
RealNameR = Request.Form("RealName")
SexR = Request.Form("Sex")
BirthdayR = Request.Form("Birthday")
IDCardR = Request.Form("IDCard")
EmailR = Request.Form("Email")
LinkMethodR = Request.Form("LinkMethod")
AddressR = Request.Form("Address")
MedHistoryR = Request.Form("MedHistory")
MedRecordR = Request.Form("MedRecord")
OtherInfoR = Request.Form("OtherInfo")
MessageBox(Request.Form("Password"))
Dim RS
Set RS=Server.CreateObject("ADODB.RecordSet")
RS.ActiveConnection=Conn
RS.Source = "Select * From [USER] Where UserName='"&UserNameR&"'"
RS.CursorType = adOpenKeyset
RS.CursorLocation = adUseServer
RS.LockType = adLockReadOnly
RS.Open
'查詢用戶是否已經存在
If Not(RS.Eof Or RS.Bof) Then
Response.write "<script language='javascript'>" &Chr(13)
Response.write "alert('用戶名已存在!');" &Chr(13)
Response.write "javascript:history.go(-1);"&Chr(13)
Response.write "</script>" &Chr(13)
Response.End
Else
RS.Close
'用戶不存在,進行存儲過程
RS.Source = "Select * From [USER] Where (ID IS Null)"
RS.LockType = adLockOptimistic
RS.Open
'添加數據集
RS.AddNew
RS("Username") = UserNameR
RS("Password") = PasswordR
RS("Question") = QuestionR
RS("Answer") = AnswerR
RS("RealName") = RealNameR
RS("Sex") = SexR
RS("Birthday") = BirthdayR
RS("IDCard") = IDCardR
RS("Email") = EmailR
RS("LinkMethod") = LinkMethodR
RS("Address") = AddressR
RS("MedHistory") = MedHistoryR
RS("MedRecord") = MedRecordR
RS("OtherInfo") = OtherInfoR
RS.Update
End If
'掃尾工作
RS.close
Set RS = nothing
ConnClose()
Response.write "<script language='javascript'>" &Chr(13)
Response.write "alert('注冊成功!請返回登陸...');" &Chr(13)
Response.write "window.document.location.href='Login.asp';"&Chr(13)
Response.write "</script>" &Chr(13)
Response.End
%>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -