新用户注册

<% Dim UserName,Userpass,Userpass2,Usermail,truename,usersex,trueweb,userip,userip1,userip2 If request.QueryString("action")="save" Then UserName=replace(trim(Request.Form("UserName")),"'","‘") Userpass=replace(trim(Request.Form("Userpass")),"'","‘") Userpass2=replace(trim(Request.Form("Userpass2")),"'","‘") Usermail=trim(Request.Form("Usermail")) truename=replace(trim(Request.Form("truename")),"'","‘") trueweb=replace(trim(Request.Form("trueweb")),"'","‘") usersex=left(Request.Form("usersex"),4) If UserName="" or Userpass="" or Userpass2="" or Usermail="" or truename="" or trueweb="" or usersex="" or IsValidEmail(Usermail)=falseh Then Response.Write ("注册用户失败! 必须真实填写全部注册内容.") Response.Write ("
返回") Response.end End If userip1 = Request.ServerVariables("HTTP_X_FORWARDED_FOR") userip2 = Request.ServerVariables("REMOTE_ADDR") If userip1 = "" Then userip = userip2 Else userip = userip1 End If 'conn.execute("insert into [ylmv_user] (UserName,Password,Sex,Email,Name,web,LoginIP) values ('"&UserName&"','"&Userpass&"','"&usersex&"','"&Usermail&"','"&truename&"','"&trueweb&"','"&userip&"')") set rs=server.createobject("adodb.recordset") sql="select * from [ylmv_user] where username='"&UserName&"'" rs.open sql,conn,1,3 if not rs.eof then Response.Write ("注册用户失败! 这个用户名已经被占用,请更换其他名称.") Response.Write ("
返回") Response.end else rs.addnew rs("username")=username rs("password")=Userpass rs("Sex")=usersex rs("email")=Usermail rs("Name")=truename rs("web")=trueweb rs("LoginIP")=userip rs.update end if rs.close Response.Write ("注册用户成功!
您现在可以立即登陆了.") Response.Write ("
关闭窗口") conn.close set conn=nothing Else %>

用 户 注 册

用户名称: | *登陆名称(中文/字母/数字)
用户密码: | *登陆密码(英文字母/数字)
验证密码: | *再重复输入一次用户密码
电子邮件: | *经常使用的E-mail
站长姓名: | *个人音乐网要用
网站名称: | *个人音乐网的名称
用户称呼: | *
<%Response.Write (MusicWord)%>

<%End If%>
<% '检查EMAIL格式是否正确 Function IsValidEmail(email) Dim names, name, i, c IsValidEmail = TRUE names = Split(email, "@") If UBound(names) <> 1 Then IsValidEmail = FALSE Exit Function End If For Each name in names If Len(name) <= 0 Then IsValidEmail = FALSE Exit Function End If For i = 1 To Len(name) c = LCase(Mid(name, i, 1)) 'If InStr("`!@#$%^&*()+=|\?';:<>,。，~！·￥……—（）——、；：“’《》？", c) <> 0 AND NOT IsNumeric(c) Then '支持中文格式地址 If InStr("abcdefghijklmnopqrstuvwxyz_-.", c) <= 0 AND NOT IsNumeric(c) Then '不支持中文格式地址 IsValidEmail = FALSE Exit Function End If Next If Left(name, 1) = "." or Right(name, 1) = "." Then IsValidEmail = FALSE Exit Function End If Next If InStr(names(1), ".") <= 0 Then IsValidEmail = FALSE Exit Function End If i = Len(names(1)) - InStrRev(names(1), ".") If i <> 2 AND i <> 3 Then IsValidEmail = FALSE Exit Function End If If InStr(email, "..") > 0 Then IsValidEmail = FALSE End If End Function %>