📄 saveuser.asp
字号:
<!--#include file="conn.asp"-->
<!--#include file="config.asp"-->
<%
dim id,userid,pwd,username,mail,tel,realname,password,num,lastlogin,from,city,add,content,job,State,qq,ZipCode,sfz,ans,qus,autoreg,dj,huser
id=request.Form("id")
userid=checkStr(request.Form("userid"))
pwd=checkStr(request.Form("password"))
username=checkStr(request.Form("username"))
city=checkStr(request.Form("city"))
job=checkStr(request.Form("job"))
State=checkStr(request.Form("State"))
mail=checkStr(request.Form("mail"))
tel=checkStr(request.Form("tel"))
qq=checkStr(request.Form("qq"))
sfz=checkStr(request.Form("sfz"))
add=checkStr(request.Form("add"))
ZipCode=checkStr(request.Form("ZipCode"))
content=checkStr(request.Form("content"))
autoreg=checkStr(request.Form("autoreg"))
dj=checkStr(request.Form("dj"))
ans=checkStr(request.Form("ans"))
qus=checkStr(request.Form("qus"))
huser=checkStr(request.Form("huser"))
if userid="" then
response.Write("<script>alert('用户名不能为空!');history.back()</script>")
response.End()
end if
if len(pwd)<6 then
response.Write("<script>alert('密码必须大于6位!');history.back()</script>")
response.End()
end if
dim check
if id<>"" then
set check=conn.execute("select userid from users where userid='"&userid&"' and id<>"&id&"")
else
set check=conn.execute("select userid from users where userid='"&userid&"'")
end if
if not check.eof then
response.Write("<script>alert('用户名已存在!');history.back()</script>")
response.End()
end if
check.close
set check=nothing
dim rs
set rs=server.CreateObject("adodb.recordset")
if id<>"" then
rs.open "select * from users where id="&id&"",conn,1,3
else
rs.open "users",conn,1,3
rs.addnew
end if
rs("userid")=userid
rs("username")=username
rs("password")=pwd
rs("city")=city
rs("job")=job
rs("State")=State
rs("mail")=mail
rs("tel")=tel
rs("qq")=qq
rs("sfz")=sfz
rs("add")=add
rs("ZipCode")=ZipCode
rs("content")=content
rs("dj")=dj
rs("ans")=ans
rs("qus")=qus
if huser="" then
huser=0
end if
rs("huser")=huser
if id<>"" then
'
else
rs("autoreg")=1
rs("dj")="普通会员"
end if
rs.update
rs.close
set rs=nothing
if id<>"" then
response.Write("<script>alert('修改成功!');location='user.asp'</script>")
else
response.Write("<script>alert('添加成功!');location='user.asp'</script>")
end if
response.End()
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -