咖啡日语论坛

 找回密码
 注~册
搜索
查看: 1313|回复: 7

用户注册模块---给想自己动手做网站的人

[复制链接]
发表于 2004-3-23 23:00:00 | 显示全部楼层 |阅读模式


register.htm文件程序代码:

<html>

<head>

<title>用户注册</title>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

<link rel="stylesheet" href="css/style.css">

</head>

<body bgcolor="#FFFFFF" topmargin="0">

<div align="center">

<form name=userlogin method=post action="register.asp" >

<table width="760" border="1" cellspacing="0" cellpadding="0" bordercolor="#FFA440" align="center">

<tr>

<td>

<table width="650" border="0" cellspacing="0" cellpadding="0" align="center">

<tr>

<td width="19"> </td>

<td width="608">

<table border="0" width="100%" cellspacing="0" cellpadding="0" align="center">

<tr>

<td valign="top">

<div align="left"> 

</div>

<table border="0" width="100%" cellspacing="0" cellpadding="2" height="41">

<tr bgcolor="#FFFFCC">

<td height="37">

<div align="center" class="p12blue"><b><font color="#000000">请填写用户个人信息</font>

</b></div>

</td>

</tr>

</table>

<br>

<table width="100%" border="0" cellpadding="0" cellspacing="2">

<tr>

<td width="30%" valign="middle" align="RIGHT" bgcolor="#F0F0F0">*注册名:</td>

<td width="70%" valign="top">

<input type=text name="username" size=20 maxlength=20>

</td>

</tr>

<tr>

<td valign="middle" align="RIGHT" bgcolor="#F0F0F0">*密码:</td>

<td valign="top">

<input type="password" name="password1" maxlength="12" size="12">

</td>

</tr>

<tr>

<td valign="middle" align="RIGHT" bgcolor="#F0F0F0">*请再次输入密码:</td>

<td valign="top">

<input type="password" name="password2" maxlength="12" size="12">

</td>

</tr>

<tr>

<td valign="middle" bgcolor="#F0F0F0">

<div align="right">*Email 地址:</div>  

</td>  

<td valign="top">    

<input type=text name="Email" size=20 maxlength=20>  

</td>  

</tr>  

<tr>    

<td valign="middle" align="right" bgcolor="#F0F0F0">    

<div align="right">姓名:</div>  

</td>  

<td valign="top">    

<input type=text name="Name" size=20 maxlength=20>  

</td>  

</tr>  

<tr>    

<td valign="middle" align="RIGHT" bgcolor="#F0F0F0">性别:</td>  

<td valign="middle">    

<input type="radio" name="Sex" value="女" checked>  

女    

<input type="radio" name="Sex" value="男">  

男 </td>  

</tr>  

<tr>    

<td valign="middle" align="RIGHT" bgcolor="#F0F0F0">联系地址:</td>  

<td valign="middle">    

<input type=text name="Address" size=40 maxlength=100>  

</td>  

</tr>  

<tr>    

<td valign="middle" align="RIGHT" bgcolor="#F0F0F0">邮政编码:</td>  

<td valign="middle">    

<input type=text name="zipcode" size=6 maxlength=6>  

</td>  

</tr>  

<tr>    

<td valign="middle" align="RIGHT" bgcolor="#F0F0F0">联系电话:</td>  

<td valign="middle">    

<input type=text name="Phone" size=20 maxlength=20>  

</td>  

</tr>  

<input type=hidden name=mailpublic value=yes>  

<input type=hidden name=public value=yes>  

</table>  

<br>  

<table width="100%" border="0" align="CENTER" valign="TOP">  

<tr align="CENTER" valign="TOP" bgcolor="#FFFFCC">    

<td>    

<center>  

<input type="submit" name="Write2" value=" 确认  ">  

   <input type="RESET" name="Reset2" value="重新再填">

  <a href="default.htm" target="_parent">返回主页</a>  

</center>  

</td>  

</tr>  

</table>  

</td>  

</tr>  

</table>  

<p align="center"> </p>  

</td>  

<td width="23"> </td>  

</tr>  

</table>  

</td>  

</tr>  

</table>  

</form>  

<br>  

</div>  

</body>  

</html>  

回复

使用道具 举报

 楼主| 发表于 2004-3-23 23:00:00 | 显示全部楼层
register.asp文件程序代码:
<!--#include file="inc/adovbs.inc"-->
<!--#include file="inc/constant.inc"-->
<%
if trim(request("password2"))<>trim(request("password1")) then
  response.write "两次输入的密码不一致!!"
  response.write("请<a href='javascript:window.history.back();'>返回重新注册</a>")
   response.end
end if
set conn=server.createobject("ADODB.connection")
set rs=server.createobject("ADODB.recordset")
conn.open database,sql_id,sql_pwd
sql= "Select * From userinfo where username='"+request("username")+"'"
rs.open sql,conn,adOpenStatic,adLockOptimistic
if rs.eof then
   rs.addnew
   rs("username")=trim(request("username"))
   rs("password")=trim(request("password"))
   rs("email")=trim(request("email"))
   rs("name")=trim(request("name"))
   rs("sex")=trim(request("sex"))
   rs("address")=trim(request("address"))
   rs("zipcode")=trim(request("zipcode"))
   rs("phone")=trim(request("phone"))
   rs("logip")=request.ServerVariables("REMOTE_ADDR")
   rs("logtime")=now()
   rs.update
   rs.close
   set rs=nothing
   conn.close
   set conn=nothing

   response.write("用户名"&request("username")&"注册成功,请<a href='default.htm'>返回</a>")   
else
   response.write("用户名"&request("username")&"已有人使用,请<a href='javascript:window.history.back();'>返回</a>换名输入")
end if
%>
回复 支持 反对

使用道具 举报

 楼主| 发表于 2004-3-23 23:00:00 | 显示全部楼层
二个文件的程序代码中,有几点说明:
1.        request.servervariables(“REMOTE_ADDR”)返回的是用户登录计算机的IP地址。
2.        Now()函数是返回用户登录的时间。
3.        Rs.open sql,adopenstatic,adlockoptimistic中,adopenstatic,adlockoptimistic参数在adovbs.inc中有定义。
4.        Javascript:windows.history.back()是Javascript脚本的方法调用,其功能是和浏览器上的“后退”按钮功能完全一致。
5.        Rs.addnew是向结果集中插入新的记录。
6.        Rs.update提交新的记录,将数据写入数据表中。
7.        Trim函数的功能是去除字符串首尾的所有空格字符。

回复 支持 反对

使用道具 举报

发表于 2004-3-23 23:00:00 | 显示全部楼层
<!-- #include file=../inc/BBSsetup.asp -->
<!-- #include file=../inc/User_Setup.asp -->
<!-- #include file=../inc/Ubbcode.asp -->
<!-- #include file=../inc/Board_popfun.asp -->
<!-- #include file=inc/User_fun.asp -->
<!-- #include file=inc/UserTopic.asp -->
<!-- #include file=inc/Mail_fun.asp -->
<!-- #include file=../inc/Constellation2.asp -->
<%
DEF_BBS_HomeUrl = "../"

Form_FaceWidth = DEF_AllFaceMaxWidth
Form_FaceHeight = DEF_AllFaceMaxWidth
GBL_CHK_PWdFlag = 0
initDatabase
GBL_CHK_TempStr = ""

SiteHead(DEF_SiteNameString & " - 用户会员区")
UpdateOnlineUserAtInfo GBL_board_ID,"注册新用户"

Dim AttestNumber
AttestNumber = 0
Dim Form_ID

UserTopicTopInfo
DisplayUserNavigate("新用户注册")

If LMT_EnableRegNewUsers = 1 Then
        If Request.form("JoinFlag") <> "" Then
                If Request.Form("SubmitFlag")="29d98Sasphouseasp8asphnet" Then
                        GBL_CHK_TempStr = ""
                        ApplyFlag = 1
                        checkFormDate
                       
                        If GBL_CHK_Flag = 0 Then
                                Response.WRite "<p><font color=ff0000 class=RedFont><b>" & GBL_CHK_TempStr & "</b></font>" & VbCrLf
                                JoinForm
                        Else
                                If saveFormData = 1 Then
                                        displayAccessFull
                                Else
                                        Response.WRite "<p><font color=ff0000 class=RedFont><b>" & GBL_CHK_TempStr & "</b></font>" & VbCrLf
                                        JoinForm
                                End If
                        End If
                Else
                        JoinForm
                End If
        Else
                DisplayUserAgreement
        End If
Else
        Response.Write "<p>
论坛停止新用户注册中,请联系管理员."
End If
UserTopicBottomInfo
closeDataBase
SiteBottom
If GBL_ShowBottomSure = 1 Then Response.Write GBL_SiteBottomString

Function DisplayUserAgreement

        %><p><form action=UserJoin.asp method=post>
        <input name=JoinFlag type=hidden value=dkls>
<!-- #include file=inc/User_Reg.asp -->
<input type="submit" value="我同意" class=fmbtn></form>
        <%

End Function

Function JoinForm%>

        <script LANGUAGE="JavaScript" TYPE="text/javascript">
        function setface()
        {
                window.open('facelist.asp','','width=250,height=450 scrollbars=auto,status=no');
        }
        </script>

        <script language=JavaScript>
        <!--
        var ValidationPassed = true;
        function isnum(str)
        {
                rset="";
                for(i=0;i<str.length;i++)
                {
                        if(str.charAt(i)>="0" && str.charAt(i)<="9")
                        {
                        }
                        else
                        {
                                return 0;
                        }
                }
                return 1;
        }

        function changeface()
        {
                var temp;
                temp=document.LeadBBSFm.Form_userphoto.value;
                if (temp!="" && isnum(temp)==1 && temp.length==4)
                {
                        if (parseInt(temp) > 0 && parseInt(temp) <= <%=DEF_faceMaxNum%>)
                        {
                                document.faceimg.src='<%=DEF_BBS_HomeUrl%>images/face/'+temp+'.gif';
                        }
                        else
                        {
                                alert("错误!此图像代号不存在!");
                                document.faceimg.src='<%=DEF_BBS_HomeUrl%>images/null.gif';
                                document.LeadBBSFm.Form_userphoto.value='';
                                ValidationPassed = false;
                        }
                }
                else
                {
                        alert("错误!此图像代号不存在!\n图像代号必须是4位数<%if len(Cstr(DEF_faceMaxNum))>4 then Response.Write "或以上"%>,比如 0001 ,最大为<%=DEF_faceMaxNum%>");
                        document.faceimg.src='<%=DEF_BBS_HomeUrl%>images/null.gif';
                        document.LeadBBSFm.Form_userphoto.value='';
                        ValidationPassed = false;
                }
        }
        <%If DEF_AllDefineFace = 1 Then%>
        function changeface2()
        {
                var temp,obj;
                obj=document.LeadBBSFm;
                if(obj.Form_FaceWidth.value!="")
                {
                        if (! isnum(obj.Form_FaceWidth.value))
                        {
                                alert("自定义头像宽度必须是数字!\n");
                                obj.Form_FaceWidth.focus();
                                return;
                        }
                        else
                        {
                                if(obj.Form_FaceWidth.value<20 || obj.Form_FaceWidth.value><%=DEF_AllFaceMaxWidth%>)
                                {
                                        alert("自定义头像宽度必须在20-<%=DEF_AllFaceMaxWidth%>之间!\n");
                                        obj.Form_FaceWidth.focus();
                                        return;
                                }
                        }
                }

                if(obj.Form_FaceHeight.value!="")
                {
                        if (! isnum(obj.Form_FaceHeight.value))
                        {
                                alert("自定义头像高度必须是数字!\n");
                                obj.Form_FaceHeight.focus();
                                return;
                        }
                        else
                        {
                                if(obj.Form_FaceHeight.value<20 || obj.Form_FaceHeight.value><%=DEF_AllFaceMaxWidth%>)
                                {
                                        alert("自定义头像高度必须在20-<%=DEF_AllFaceMaxWidth%>之间!\n");
                                        obj.Form_FaceHeight.focus();
                                        return;
                                }
                        }
                }

                temp=document.LeadBBSFm.Form_FaceUrl.value;
                if (temp!="")
                {
                        document.faceimg.src=temp;
                        document.faceimg.width=obj.Form_FaceWidth.value;
                        document.faceimg.height=obj.Form_FaceHeight.value;
                }
        }
        <%End If%>

        function form_onsubmit(obj)
        {
                if(obj.Form_username.value=="")
                {
                        alert("请输入你的用户名!\n");
                        ValidationPassed = false;
                        obj.Form_username.focus();
                        return;
                }
               
                if(obj.Form_username.value.length<(<%=DEF_ShortestUserName%>/2))
                {
                        alert("用户名长度至少需要<%=DEF_ShortestUserName%>个字符!\n");
                        ValidationPassed = false;
                        obj.Form_username.focus();
                        return;
                }

                if(obj.Form_mail.value=="")
                {
                        alert("请输入你的真实邮箱地址!\n");
                        ValidationPassed = false;
                        obj.Form_mail.focus();
                        return;
                }

                if(obj.Form_password1.value=="")
                {
                        alert("请输入你的密码!\n");
                        ValidationPassed = false;
                        obj.Form_password1.focus();
                        return;
                }

                if(obj.Form_password2.value=="")
                {
                        alert("请输入你的验证密码!\n");
                        ValidationPassed = false;
                        obj.Form_password2.focus();
                        return;
                }

                if(obj.Form_password1.value!=obj.Form_password2.value)
                {
                        alert("你的两次密码输入不相同!\n");
                        ValidationPassed = false;
                        obj.Form_password1.focus();
                        return;
                }

                if(obj.Form_Question.value=="")
                {
                        alert("请输入密码提示!\n");
                        ValidationPassed = false;
                        obj.Form_Question.focus();
                        return;
                }

                if(obj.Form_Answer.value=="")
                {
                        alert("请输入提示答案!\n");
                        ValidationPassed = false;
                        obj.Form_Answer.focus();
                        return;
                }
                if(obj.Form_icq.value!="")
                {
                        if (! isnum(obj.Form_icq.value))
                        {
                                alert("喂,你填入了ICQ框中填入了东西,但你的ICQ号码怎么不是数字!\n");
                                ValidationPassed = false;
                                obj.Form_icq.focus();
                                return;
                        }
                }

                if(obj.Form_oicq.value!="")
                {
                        if (! isnum(obj.Form_oicq.value))
                        {
                                alert("喂,你填入了QQ框中填入了东西,但你的QQ号码怎么不是数字?\n");
                                ValidationPassed = false;
                                obj.Form_oicq.focus();
                                return;
                        }
                }

                if(obj.Form_byear.value!="")
                {
                        if (! isnum(obj.Form_byear.value))
                        {
                                alert("喂,你填入了你的出生年,但你的年份怎么不是数字!\n");
                                ValidationPassed = false;
                                obj.Form_byear.focus();
                                return;
                        }
                }

                if(obj.Form_bmonth.value!="")
                {
                        if (! isnum(obj.Form_bmonth.value))
                        {
                                alert("喂,你填入了你的出生月,但你的月份怎么不是数字!\n");
                                ValidationPassed = false;
                                obj.Form_bmonth.focus();
                                return;
                        }
                }

                if(obj.Form_bday.value!="")
                {
                        if (! isnum(obj.Form_bday.value))
                        {
                                alert("喂,你填入了你的出生日,但你的出生日怎么不是数字!\n");
                                ValidationPassed = false;
                                obj.Form_bday.focus();
                                return;
                        }
                }

                if(obj.Form_userphoto.value!="")
                {
                        if (! isnum(obj.Form_bday.value))
                        {
                                alert("用户图像,只能是001-318之间的数字!\n");
                                ValidationPassed = false;
                                obj.Form_bday.focus();
                                return;
                        }
                }
               
                if(obj.Form_Underwrite.value.length>255)
                {
                        alert("用户签名内容要小于255个字符!\n");
                        ValidationPassed = false;
                        obj.Form_Underwrite.focus();
                        return;
                }
                <%If DEF_AllDefineFace = 1 Then%>
                if(obj.Form_FaceWidth.value!="")
                {
                        if (! isnum(obj.Form_FaceWidth.value))
                        {
                                alert("自定义头像宽度必须是数字!\n");
                                ValidationPassed = false;
                                obj.Form_FaceWidth.focus();
                                return;
                        }
                        else
                        {
                                if(obj.Form_FaceWidth.value<20 || obj.Form_FaceWidth.value><%=DEF_AllFaceMaxWidth%>)
                                {
                                        alert("自定义头像宽度必须在20-<%=DEF_AllFaceMaxWidth%>之间!\n");
                                        ValidationPassed = false;
                                        obj.Form_FaceWidth.focus();
                                        return;
                                }
                        }
                }

                if(obj.Form_FaceHeight.value!="")
                {
                        if (! isnum(obj.Form_FaceHeight.value))
                        {
                                alert("自定义头像高度必须是数字!\n");
                                ValidationPassed = false;
                                obj.Form_FaceHeight.focus();
                                return;
                        }
                        else
                        {
                                if(obj.Form_FaceHeight.value<20 || obj.Form_FaceHeight.value><%=DEF_AllFaceMaxWidth%>)
                                {
                                        alert("自定义头像高度必须在20-<%=DEF_AllFaceMaxWidth%>之间!\n");
                                        ValidationPassed = false;
                                        obj.Form_FaceHeight.focus();
                                        return;
                                }
                        }
                }<%End if
                If DEF_EnableAttestNumber > 2 Then%>
               
                if(obj.ForumNumber.value=="")
                {
                        alert("请输入验证码!\n");
                        ValidationPassed = false;
                        obj.ForumNumber.focus();
                        return;
                }<%End If%>
                ValidationPassed = true;
                return true;
        }

        function submitonce(theform)
        {
                form_onsubmit(theform);
                if(ValidationPassed == false)return;
                if (document.all||document.getElementById)
                {
                        for (i=0;i<theform.length;i++)
                        {
                                var tempobj=theform.elements;
                                if(tempobj.type.toLowerCase()=="submit"||tempobj.type.toLowerCase()=="reset")
                                tempobj.disabled=true;
                        }
                }
        }
        -->
        </script>

<FORM action=UserJoin.asp method=post name=LeadBBSFm onSubmit="submitonce(this);return ValidationPassed;">
        <p><b>新用户注册</b>

       

        </p>
        <TABLE border=0 cellpadding="0" cellspacing="0">
        <TR align=middle>
                <TD colspan="2">
                        <TABLE border=0 class=font width="100%" cellpadding="0" cellspacing="0">
                        <TR>
                                <TD height=2 bgcolor="#ececff" class=TBBG1><img src="<%=DEF_BBS_HomeUrl%>images/null.GIF" height=1></TD>
                                <TD height=2 bgcolor="#ececff" class=TBBG1><img src="<%=DEF_BBS_HomeUrl%>images/null.GIF" height=1></TD>
                        </TR>
                        <TR>
                                <TD height="25" align=center>
                                        <p>*用户名称:
                                </TD>
                                <TD height="25">
                                        <p>
                                        <input class=fminpt maxLength=14 name="Form_username" size=14 Value="<% If Form_username<>"" Then Response.Write Server.HtmlEncode(Form_Username)%>">
                                </TD>
                        </TR>
                        <TR>
                                <TD height="25" align=center>
                                        <p>*你的密码:
                                </TD>
                                <TD height="25">
                                        <input class=fminpt name=SubmitFlag type=hidden value="29d98Sasphouseasp8asphnet">
                                        <input class=fminpt name=JoinFlag type=hidden value="3kkdk">
                                        <input class=fminpt maxLength=20 name="Form_password1" size=14 type=password Value="<% If Form_password1<>"" Then Response.Write Server.HtmlEncode(Form_password1)%>">
                                </TD>
                        </TR>
                        <TR>
                                <TD height="25" align=center>
                                        <p>*验证密码:
                                </TD>
                                <TD height="25">
                                        <input class=fminpt maxlength=20 name="Form_password2" size=14 type=password Value="<% If Form_password2<>"" Then Response.Write Server.HtmlEncode(Form_password2)%>">
                                </TD>
                        </TR>
                        <TR>
                                <TD height="25" align=center>
                                        <p>*电子邮件:
                                </TD>
                                <TD height="25">
                                        <input class=fminpt maxLength=60 name=Form_mail size=36 Value="<% If Form_mail<>"" Then Response.Write Server.HtmlEncode(Form_mail)%>">
                                </TD>
                        </TR>
                        <TR>
                                <TD height="25" align=center>
                                        <p>*密码提示:
                                </TD>
                                <TD height="25">
                                        <input class=fminpt maxLength=20 name=Form_Question size=36 Value="<% If Form_Question<>"" Then Response.Write Server.HtmlEncode(Form_Question)%>">
                                </TD>
                        </TR>
                        <TR>
                                <TD height="25" align=center>
                                        <p>*提示答案:
                                </TD>
                                <TD height="25">
                                        <input class=fminpt maxlength=20 name=Form_Answer size=36 Value="<% If Form_Answer<>"" Then Response.Write Server.HtmlEncode(Form_Answer)%>">
                                </TD>
                        </TR>
                        <TR>
                                <TD height="25" align=center>
                                        <p>个人主页:
                                </TD>
                                <TD height="25">
                                        <input class=fminpt maxlength=250 name=Form_homepage size=36 Value="<% If Form_homepage<>"" Then Response.Write Server.HtmlEncode(Form_homepage)%>">
                                </TD>
                        </TR>
                        <TR>
                                <TD height="25" align=center>
                                        <p>ICQ 号码:
                                </TD>
                                <TD height="25">
                                        <input class=fminpt maxlength=10 name=Form_icq size=36 Value="<% If Form_icq<>"" Then Response.Write Server.HtmlEncode(Form_icq)%>">
                                </TD>
                        </TR>
                        <TR>
                                <TD height="25" align=center>
                                        <p>QQ号码:
                                </TD>
                                <TD height="25">
                                        <input class=fminpt maxlength=10 name=Form_oicq size=14 Value="<% If Form_oicq<>"" Then Response.Write Server.HtmlEncode(Form_oicq)%>">
                                </TD>
                        </TR>
                        <TR>
                                <TD height="25" align=center>
                                        <p>联系地址:
                                </TD>
                                <TD height="25">
                                        <input class=fminpt maxlength=150 name=Form_address size=36 Value="<% If Form_address<>"" Then Response.Write Server.HtmlEncode(Form_address)%>">
                                </TD>
                        </TR>
                        <TR>
                                <TD height="25" align=center>
                                        <p>你的性别:
                                </TD>
                                <TD height="25">
                                        <select name="Form_sex">
                                                <option value="密">保密</option>
                                                <option value="男" <% If Form_sex = "男" Then Response.Write "selected"%>>男</option>
                                                <option value="女" <% If Form_sex = "女" Then Response.Write "selected"%>>女</option>
                                        </select>
                                </TD>
                        </TR>
                        <TR>
                                <TD height="25" align=center>
                                        <p>用户头像:
                                </TD>
                                <TD height="25">
                                        <input class=fminpt onchange="javascript:changeface();" maxlength=4 name=Form_userphoto size=4 Value="<% If Form_userphoto<>"" Then Response.Write Server.HtmlEncode(string(4-len(cstr(Form_userphoto)),"0")&Form_userphoto)%>">
                                        <span style='cursor:hand' title='查看头像代号' onclick="setface();">查看头像代号</span>
                                        <%If Form_userphoto<>"" and isNumeric(Form_userphoto) Then%><img name=faceimg id=faceimg src=<%=DEF_BBS_HomeUrl%>images/face/<%=string(4-len(cstr(Form_userphoto)),"0")&Form_userphoto%>.gif align=absmiddle width=62 height=62><%Else%><img name=faceimg id=faceimg src=<%=DEF_BBS_HomeUrl%>images/null.gif align=absmiddle><%End If%>
                                </TD>
                        </TR><%If DEF_AllDefineFace = 1 Then%>
                        <TR>
                                <TD height="25" align=center>
                                        <p>自定头像:
                                </TD>
                                <TD height="25">
                                        <input class=fminpt onchange="javascript:changeface2();" maxlength=250 name=Form_FaceUrl size=36 Value="<%=HtmlEncode(Form_FaceUrl)%>">
                                </TD>
                        </TR>
                        <TR>
                                <TD height="25" align=center>
                                        <p>头像大小:
                                </TD>
                                <TD height="25">
                                        宽: <input class=fminpt onchange="javascript:changeface2();" maxlength=<%=len(DEF_AllFaceMaxWidth)%> name=Form_FaceWidth size=3 Value="<%=HtmlEncode(Form_FaceWidth)%>">(20-<%=DEF_AllFaceMaxWidth%>)
                                        高: <input class=fminpt onchange="javascript:changeface2();" maxlength=<%=len(DEF_AllFaceMaxWidth)%> name=Form_FaceHeight size=3 Value="<%=HtmlEncode(Form_FaceHeight)%>">(20-<%=DEF_AllFaceMaxWidth%>)
                                </TD>
                        </TR><%End If%>
                        <TR>
                                <TD height="25" align=center>
                                        <p>你的生日:
                                </TD>
                                <TD height="25" align="left">
                                        <p>
                                        <input class=fminpt maxlength=4 name=Form_byear size=4 Value="<% If Form_byear<>"" Then
                                                Response.Write Server.HtmlEncode(Form_byear)
                                        Else
                                                Response.Write "19"
                                        End If%>"> 年
                                        <input class=fminpt maxlength=2 name=Form_bmonth size=2 Value="<% If Form_bmonth<>"" Then Response.Write Server.HtmlEncode(Form_bmonth)%>">
                                        月 <input class=fminpt maxlength=2 name=Form_bday size=2 Value="<% If Form_bday<>"" Then Response.Write Server.HtmlEncode(Form_bday)%>">
                                        日</TD>
                        </TR>
                        <TR>
                                <TD height="25" align=center>
                                        <p>签名-UBB:
                                </TD>
                                <TD height="25">
                                        <textarea class=fmtxtra name=Form_Underwrite rows=5 cols=34><%If Form_Underwrite <> "" Then Response.Write VbCrLf & htmlEncode(Form_Underwrite)%></textarea>
                                </TD>
                        </TR><%If DEF_EnableAttestNumber > 2 Then%>
                        <TR>
                                <TD height="25" align=center>
                                        <p>验 证 码:
                                </TD>
                                <TD height="25">
                                        <TABLE border=0 class=font width="100%" cellpadding="0" cellspacing="0">
                                        <TR>
                                                <TD>
                                                <input name=ForumNumber maxlength=4 size=4 value="<%=htmlencode(Request("RndNumber"))%>" class=fminpt></td>
                                                <td>&nbsp;请在框中输入<img src=<%=DEF_BBS_HomeUrl%>User/number.asp?n=<%=timer%> align=absmiddle width=32 height=12>,否则无法注册</td></tr></table>
                                </TD>
                        </TR><%End If%>
                        </TABLE>
                </TD>
        </TR>
        <TR>
                <TD>&nbsp;</TD>
                <TD width="95%" height="30" align="center">
                        <input name=submit type=submit value=" 申 请 " class=fmbtn>
                        <input name=b1 type=reset value=" 重 写 " class=fmbtn>
                </TD>
        </TR>
        <TR>
                <TD colspan="2" height=2 bgcolor="ececff" class=TBBG1><img src="<%=DEF_BBS_HomeUrl%>images/null.GIF" width=1 height=1></TD>
        </TR>
        </TABLE>
</FORM>
<%
End Function

Function saveFormData

        Dim Rs
        Set Rs = Server.CreateObject("ADODB.RecordSet")
        Rs.Open "Select top 1 * from LeadBBS_User",con,2,2
        Rs.Addnew
        Rs("UserName") = Form_UserName
        If Form_Mail<>"" Then Rs("Mail") = Form_Mail
        If Form_Address<>"" Then Rs("Address") = Form_Address
        Rs("Sex") = Form_Sex
        If Form_ICQ<>"" Then Rs("ICQ") = Form_ICQ
        If Form_OICQ<>"" Then Rs("OICQ") = Form_OICQ
        Rs("Userphoto") = Form_Userphoto
        If Form_Homepage<>"" Then Rs("Homepage") = Form_Homepage
        If Form_Underwrite<>"" Then Rs("Underwrite") = Form_Underwrite
        If Form_PrintUnderwrite<>"" Then Rs("PrintUnderwrite") = Form_PrintUnderwrite
        Rs("Pass") = MD5(Form_Password1)
        If len(Form_birthday)=14 Then
                Rs("birthday") = Form_birthday
                Dim Temp
                temp = cCur(Left(Form_birthday,4))
                If temp > 1950 and temp < 2050 Then Rs("NongLiBirth") = GetTimeValue(ConvertToNongLi(RestoreTime(Form_birthday)))
        End If

        REM 特殊数据
        Rs("ApplyTime") = Form_ApplyTime
        Rs("IP") = Form_IP
        Rs("UserLevel") = Form_UserLevel
        Rs("Officer") = Form_Officer
        Rs("Points") = DEF_User_RegPoints
        Rs("Sessionid") = Form_Sessionid
        Rs("Online") = Form_Online
        Rs("Prevtime") = Form_Prevtime
        Rs("Answer") = MD5(Form_Answer)
        Rs("Question") = Form_Question
        Rs("LastDoingTime") = Form_ApplyTime
        Rs("LastWriteTime") = Form_ApplyTime
        If DEF_UserNewRegAttestMode > 0 Then
                Rs("UserLimit") = 1
        Else
                Rs("UserLimit") = 0
        End If

        If DEF_AllDefineFace = 1 Then
                Rs("FaceUrl") = Form_FaceUrl
                Rs("FaceWidth") = Form_FaceWidth
                Rs("FaceHeight") = Form_FaceHeight
        End If
        Rs("LastAnnounceID") = 0

        Rs.Update

        Rs.Close
        Set Rs = Nothing
       
        Set Session(DEF_MasterCookies & "UDT") = Nothing
        Session(DEF_MasterCookies & "UDT") = ""
       
        Set Rs = Con.ExeCute("Select top 1 ID from LeadBBS_User Where UserName='" & Replace(Form_UserName,"'","''") & "'")
        If Not Rs.Eof Then
                Form_ID = Rs(0)
        Else
                Form_ID = 0
        End If
        Rs.Close
        Set Rs = Nothing
        saveFormData = 1

        Dim Form_ExpiresTime
        If DEF_UserActivationExpiresDay > 0 and DEF_UserActivationExpiresDay < 3650 Then
                Form_ExpiresTime = GetTimeValue(DateAdd("d",DEF_UserActivationExpiresDay,DEF_Now))
        Else
                Form_ExpiresTime = 0
        End If
        If DEF_UserNewRegAttestMode > 0 Then
                If DEF_UserNewRegAttestMode = 1 Then
                        Randomize
                        AttestNumber = Right(Fix(Rnd*Timer)+Fix(Rnd*cCur(GetTimeValue(DEF_Now))) + 10000,10)
                End If
                Con.ExeCute("insert into LeadBBS_SpecialUser(UserID,UserName,BoardID,Assort,ndatetime,ExpiresTime) values(" & Form_ID & ",'" & Replace(Form_UserName,"'","''") & "'," & AttestNumber & ",6," & GetTimeValue(DEF_Now) & "," & Form_ExpiresTime & ")")
        End If

        Con.ExeCute("Update LeadBBS_SiteInfo Set UserCount=UserCount+1")
        UpdateStatisticDataInfo 1,1,1
       
        SendRegMail

End Function

Sub SendRegMail

        Dim HomeUrl
        HomeUrl = "http://"&Request.ServerVariables("server_name")
        If Request.ServerVariables("SERVER_PORT") <> "80" Then HomeUrl = HomeUrl & ":" & Request.ServerVariables("SERVER_PORT")
        HomeUrl = Lcase(HomeUrl & Request.Servervariables("SCRIPT_NAME"))
        HomeUrl = Replace(HomeUrl,"user/userjoin.asp","")

        Dim MailBody,Topic,TextBody
        Topic = "您在" & DEF_SiteNameString & "的成功注册资料"
        MailBody = "<html>"
        TextBody = ""
        MailBody = MailBody & "<TITLE>注册信息</TITLE>"
        MailBody = MailBody & "<BODY>"
        MailBody = MailBody & "<TABLE BORDER=0 WIDTH=95% ALIGN=CENTER><TBODY><TR>"
        MailBody = MailBody & "<TD VALIGN=MIDDLE ALIGN=TOP><HR WIDTH=100% SIZE=1>"
        TextBody = TextBody & "------------------------------------------" & VbCrLf
        MailBody = MailBody & VbCrLf & "<b>" & htmlencode(Form_UserName)&",您好</b>:

"
        TextBody = TextBody & htmlencode(Form_UserName)&",您好:" & VbCrLf & VbCrLf
        MailBody = MailBody & "谢谢您注册本论坛,下面是您的注册信息!

"
        TextBody = TextBody & "谢谢您注册本论坛,下面是您的注册信息!" & VbCrLf & VbCrLf
        MailBody = MailBody & "用户名:"&htmlencode(Form_UserName)&"
"
        TextBody = TextBody & "用户名:"&htmlencode(Form_UserName) & VbCrLf
        MailBody = MailBody & "密 码:" & Form_Password1 & "
"
        TextBody = TextBody & "密 码:" & Form_Password1 & VbCrLf
        If DEF_UserNewRegAttestMode = 1 Then
                MailBody = MailBody & "验证码:" & AttestNumber & "
"
                TextBody = TextBody & "验证码:" & AttestNumber & VbCrLf
                MailBody = MailBody & "<p><b><a href=" & HomeUrl & "User/UserTurnOn.asp?user=" & urlencode(Form_UserName) & ">请点击这里,输入您的注册信息,立即激活您的用户。</a></b>
"
                TextBody = TextBody & VbCrLf & VbCrLf & "请输入下列网址,并输入您的注册信息,立即激活您的用户:" & VbCrLf & HomeUrl & "User/UserTurnOn.asp?ID=" & urlencode(Form_UserName) & VbCrLf & VbCrLf
        Else
                MailBody = MailBody & "<p>刚注册的用户需等待网站管理员进行认证才能成为正式会员,在通过之前在功能使用上会有一些限制。
"
                TextBody = TextBody & VbCrLf & VbCrLf & "刚注册的用户需等待网站管理员进行认证才能成为正式会员,在通过验证之前在功能使用上会有一些限制。" & VbCrLf
        End If
        MailBody = MailBody & "

"
        MailBody = MailBody & "<CENTER><FONT COLOR=RED><a href=""" & HomeUrl & """>欢迎经常光临论坛!</a></FONT>"
        MailBody = MailBody & "</TD></TR></TBODY></TABLE>
<HR WIDTH=95% SIZE=1>"
        MailBody = MailBody & "<P ALIGN=CENTER>" & DEF_SiteNameString & " <a href=http://www.leadbbs.com target=_blank class=NavColor>LeadBBS</a> v3.14</P>"
        TextBody = TextBody & VbCrLf & "论坛网址:" & HomeUrl & VbCrLf
        TextBody = TextBody & "------------------------------------------" & VbCrLf
        MailBody = MailBody & "</BODY>"
        MailBody = MailBody & "</HTML>"
        Select Case DEF_BBS_EmailMode
                Case 1: If SendEasyMail(Form_Mail,Topic,MailBody,TextBody) = 1 Then
                                        Response.Write "

资料成功发送到您的注册邮箱!"
                                Else
                                        Response.Write "

论坛未正确设置邮件发送,资料发送失败!"
                                End If
                Case 2: If SendJmail(Form_Mail,Topic,MailBody) = 1 Then
                                        Response.Write "

资料成功发送到您的注册邮箱!"
                                Else
                                        Response.Write "

论坛未正确设置邮件发送,资料发送失败!"
                                End If
                Case 3: If SendCDOMail(Form_Mail,Topic,TextBody) = 1 Then
                                        Response.Write "

资料成功发送到您的注册邮箱!"
                                Else
                                        Response.Write "

论坛未正确设置邮件发送,资料发送失败!"
                                End If
                Case Else:
        End Select

End Sub

Function displayAccessFull

        Response.Cookies(DEF_MasterCookies)("user") = Form_Username
        Response.Cookies(DEF_MasterCookies)("pass") = Form_password1
        con.execute("Update LeadBBS_onlineUser set UserID=" & Form_ID & ",UserName='" & Replace(Form_Username,"'","''") & "',HiddenFlag=" & DEF_UserNewRegAttestMode & " where sessionID=" & session.sessionID)%>
        <p>您已经成功注册成为论坛用户,5秒钟后页面将自动返回论坛首页。</a>

        <%If DEF_UserNewRegAttestMode = 1 Then
                Response.Write "<p><font color=green class=GreenFont>注册的用户只有浏览论坛的权限,激活用户的验证码已经成功发送到您的注册邮箱。</font>" & VbCrLf
        ElseIf DEF_UserNewRegAttestMode = 2 Then
                Response.Write "<p><font color=green class=GreenFont>注册的用户只有浏览论坛的权限,请等待网站成员对您作出验证才能成为正式会员。</font>" & VbCrLf
        End If%>
        <meta http-equiv=refresh content="5;URL=../Boards.asp">
       

        </p>

<%End Function%>

LeadBBS的,恐怖吧?
回复 支持 反对

使用道具 举报

 楼主| 发表于 2004-3-23 23:00:00 | 显示全部楼层
这个太难了。。。javascript的程序好多都看不懂。。我现在学的是用vbscript嵌入
回复 支持 反对

使用道具 举报

发表于 2004-3-23 23:00:00 | 显示全部楼层
看不懂的说

还是白猫的比较精简...



想问你们个问题,能不能来一段代码检测对方的平台,如果是手机的话转入一个页面,如果是PC的话转入另外一个页面!
回复 支持 反对

使用道具 举报

发表于 2004-3-23 23:00:00 | 显示全部楼层
以前在哪里看到过的,现在找不到了,HOHOHO
回复 支持 反对

使用道具 举报

发表于 2004-3-24 23:00:00 | 显示全部楼层
好东西,很不错,有搜索功能的源代码吗?
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注~册

本版积分规则

小黑屋|手机版|咖啡日语

GMT+8, 2024-4-27 14:30

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表