附上一个ADDNEW的使用方法
<meta http-equiv="Content-Type" c /> <!--#include file="inc/Conn.asp"--> <!--#include file="Inc/eshopcode.asp"--> <!--#include file="inc/MD5.asp"--> <% If Request.QueryString("action")="" Then Response.Redirect "Index.asp" Else Ip_address=Request.ServerVariables ("HTTP_X_FORWARDED_FOR") If Ip_address="" Then Ip_address= Request.ServerVariables ("REMOTE_ADDR") end if UserName=Trim(Request.Form("UserName")) server_v1=Cstr(Request.ServerVariables("HTTP_REFERER")) if checkstr2(UserName)=true then response.Write(" <center>您输入的用户名中含有'~!@#$%^&*(),. <>{}[]等特殊字符,请检查重填! <br> <a href='"&server_v1&"'>返回上一页 </a> </center>") response.End() end if Password=Trim(Request.Form("Password")) if checkstr2(Password)=true then response.Write(" <center>您输入的密码中含有'~!@#$%^&*(),. <>{}[]等特殊字符,请检查重填! <br> <a href='"&server_v1&"'>返回上一页 </a> </center>") response.End() end if Password=MD5(Password,16) usertruepas=trim(request.form("password")) sex=request.form("sex") Question=checkstr(Trim(Request.Form("Question"))) Answer=md5(Trim(Request.Form("Answer")),16) email=checkstr(Trim(Request.Form("email"))) if username="" or password="" then response.Write(" <center>不好意思,您填写的不完整,请后退重填,有问题请联系管理员。 </center>") response.End() end if Set ob=Conn.Execute("Select * From Dv_User Where UserName='"&UserName&"' ") If Not(ob.Eof and ob.Bof) Then Response.write " <script language='javascript'>" & chr(13) Response.write "alert('用户名已存在!');" & Chr(13) Response.write "history.go(-1);"&Chr(13) Response.write " </script>" & Chr(13) Response.End Else Set rs = Server.CreateObject("ADODB.RecordSet") sql = "select * From Dv_User" rs.Open sql,conn,1,3 rs.AddNew rs("UserName")=UserName rs("usersex")=sex rs("UserPassWord")=Password rs("usertruepas")=usertruepas rs("userQuesion")=Question rs("userAnswer")=Answer rs("Useremail")=email if request.QueryString("type")="pers" then rs("usertype")="pers" else if request.QueryString("type")="comp" then rs("usertype")="comp" end if end if Rs("JoinDate")=now() Rs("Lockuser")=0 Rs("Userclass")="新手上路" Rs("UserGroupID")=9 Rs("TitlePic")="level0.gif" Rs("UserFace")="Images/userface/image1.gif" rs("UserIM")="||||||||||||||||||" Rs("UserWidth")=32 Rs("Usertoday")="0|0|0|0|0" Rs("UserHeight")=32 Rs("UserLogins")=1 Rs("LastLogin")=now() Rs("userWealth")=100 Rs("userEP")=60 Rs("usercP")=30 Rs("UserInfo")="||||||||||||||||||||||||||||||||||||||||||" Rs("UserSetting")="1|||0|||0" Rs("UserPower")=0 Rs("UserDel")=0 Rs("UserIsbest")=0 Rs("UserMoney")=0 Rs("UserTicket")=0 Rs("UserFav")="陌生人,我的好友,黑名单" Rs("IsChallenge")=0 Rs("UserHidden")=0 Rs("UserLastIP")=ip_address Rs.Update rs.close set rs=nothing set rs2=server.createobject("adodb.recordset") sql2="select * from dv_setup" rs2.open sql2,conn,1,3 rs2("Forum_UserNum")=rs2("Forum_UserNum")+1 rs2("Forum_lastUser")=username rs2.update rs2.close set rs2=nothing end if if request.QueryString("type")="pers" then Session("PersUserName")=username Session("PersPassWord")=password session("usertype")="pers" Session.Timeout = 30 response.Cookies("37job")("persusername")=username response.Cookies("37job")("perspassword")=password response.cookies("37job").Expires=date+1 Response.write " <script language='javascript'>" & chr(13) Response.write "alert('注册成功!请接着填写求职信息');" & Chr(13) Response.write "window.document.location.href='pers_reg3.asp';"&Chr(13) Response.write " </script>" & Chr(13) Response.End end if if request.QueryString("type")="comp" then Session("CompUserName")=username Session("CompPassWord")=password session("usertype")="comp" session("CompLevel")=0 Session.Timeout = 30 response.Cookies("37job")("compusername")=username response.Cookies("37job")("comppassword")=password response.cookies("37job").Expires=date+1 Response.write " <script language='javascript'>" & chr(13) Response.write "alert('注册成功!请接着填写公司信息');" & Chr(13) Response.write "window.document.location.href='comp_reg3.asp';"&Chr(13) Response.write " </script>" & Chr(13) Response.End end if end if conn.Close set conn=nothing %>
|