?? regsave.asp
字號:
<!--#include file="conn.asp"-->
<!--#include file="md5.asp"-->
<%
if request.form("user")="" then
response.write"<script language=javascript>alert('用戶名必須填寫');this.location.href='reg.asp';</script>"
response.end
end if
if request.form("pass")="" then
response.write"<script language=javascript>alert('密碼必須填寫');this.location.href='javascript:history.go(-1)';</script>"
response.end
end if
if request.form("pass")<>request.form("conpass") then
response.write"<script language=javascript>alert('確認密碼與原密碼不一致');this.location.href='javascript:history.go(-1)';</script>"
response.end
end if
if request.form("truename")="" then
response.write"<script language=javascript>alert('真實姓名請您填寫');this.location.href='javascript:history.go(-1)';</script>"
response.end
end if
if request.form("phone")="" then
response.write"<script language=javascript>alert('電話號碼請您填寫');this.location.href='javascript:history.go(-1)';</script>"
response.end
end if
if request.form("email")="" then
response.write"<script language=javascript>alert('E-mail請您填寫');this.location.href='javascript:history.go(-1)';</script>"
response.end
end if
if request.form("post")="" then
response.write"<script language=javascript>alert('郵編請您填寫');this.location.href='javascript:history.go(-1)';</script>"
response.end
end if
if request.form("address")="" then
response.write"<script language=javascript>alert('地址請您填寫');this.location.href='javascript:history.go(-1)';</script>"
response.end
end if
username=trim(request.form("user"))
set rs=server.createobject("adodb.recordset")
sql="select * from member where cname='"&username&"'"
rs.open sql,conn,3,3
if not rs.eof then
response.write"<script language=javascript>alert('已經存在此用戶名,請重新選擇一個');this.location.href='javascript:history.go(-1)';</script>"
else
rs.addnew
rs("cname")=trim(request("user"))
rs("password")=md5(trim(request("pass")))
rs("truename")=trim(request("truename"))
rs("phone")=trim(request("phone"))
rs("email")=trim(request("email"))
rs("post")=trim(request("post"))
rs("address")=trim(request("address"))
rs("regtime")=now()
rs("ip")=request.servervariables("remote_addr")
rs.update
response.write"<script language=javascript>alert('用戶注冊成功');this.location.href='index.asp';</script>"
session("user")=username
end if
rs.close
set rs=nothing
%>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -