<!--#include file="../conn.asp" -->
<!--#include file="inc.asp" -->
<%
''*******************************************************************************
''************函数功能：去掉函数参数中的HTML标记*********************************
''*******************************************************************************
Function stripHTML(strtext)
dim arysplit,i,j, strOutput

arysplit=split(strtext,"<")
if len(arysplit(0))>0 then j=1 else j=0
for i=j to ubound(arysplit)
  if instr(arysplit(i),">") then
   arysplit(i)=mid(arysplit(i),instr(arysplit(i),">")+1)
  else
   arysplit(i)="<" & arysplit(i)
  end if
next

strOutput = join(arysplit, "")
strOutput = mid(strOutput, 2-j)
strOutput = replace(strOutput,">",">")
strOutput = replace(strOutput,"<","<")

stripHTML = strOutput
End Function
''*******************************************************************************
''**应用方法：StripHTML("string")，其中，string为要去掉HTML标记的字符串**********
''*******************************************************************************
%>
<%
if open="False" then
call sorry()
else
call reg()
end if

sub reg
%>
<%
dim server_v1,server_v2
server_v1=Cstr(Request.ServerVariables("HTTP_REFERER"))
server_v2=Cstr(Request.ServerVariables("SERVER_NAME"))
if mid(server_v1,8,len(server_v2))<>server_v2 then
   response.write ""
   response.end
end if
if Trim(Request.QueryString("ation"))="reg" then
username=Trim(Request.Form("username"))

if Instr(username,"=")>0 or Instr(username,chr(32))>0 or Instr(username,"?")>0 or Instr(username,"&")>0 or Instr(username,";")>0 or Instr(username,",")>0 or Instr(username,"'")>0 or Instr(username,chr(34))>0 or Instr(username,chr(9))>0 or Instr(username,"")>0 or Instr(username,"<")>0 or Instr(username,">")>0 or Instr(username,Chr(10))>0 or Instr(username,Chr(13))>0 or Instr(username,"#")>0 or Instr(username,"*")>0 or Instr(username,"(")>0 or Instr(username,")")>0 or Instr(username,"[")>0 or Instr(username,"]")>0 or Instr(username,"{")>0 or Instr(username,"}")>0 or Instr(username,"/")>0 or Instr(username,"\")>0 or  Instr(username,"!")>0 then
'response.write("请正确输入用户名和密码")
response.write ("<script>window.alert('用户名中含有限制字符，请修改!');window.history.back();</script>")
response.end
end if
'<script>alert("没有登录不能进入会员中心，请登录或注册!")<script>history.back();</script></script>
password=Trim(Request.Form("password"))
shuyu=Trim(Request.Form("shuyu"))
sex=Trim(Request.Form("sex"))
bookname=Trim(Request.Form("bookname"))
fenmian=Trim(Request.Form("fenmian"))
url=Trim(Request.Form("url"))
qq=Trim(Request.Form("qq"))
gongao=Trim(Request.Form("gongao"))
kg=Trim(Request.Form("kg"))
shuyu=stripHTML(shuyu)
bookname=stripHTML(bookname)
url=stripHTML(url)
qq=stripHTML(qq)
gongao=stripHTML(gongao)

set rs=server.CreateObject("adodb.recordset")
sql="select * from diaryuser where username='"&username&"'"
rs.open sql,conn,1,1
if not (rs.bof and rs.eof) then
Response.Write("<script language=JavaScript>alert('该用户名已经被注册，请尝试其他名称.');history.back()</script>")
else
set rs=server.CreateObject("adodb.recordset")
sql="select * from diaryuser"
rs.open sql,conn,1,3
booktotal0=rs.recordcount'新注册日记本之前总数
rs.addnew
rs("username")=username
rs("password")=password
rs("shuyu")=shuyu
rs("sex")=sex
rs("bookname")=bookname
rs("fenmian")=fenmian
rs("url")=url
rs("qq")=qq
rs("gongao")=gongao
rs("regtime")=now()
rs.update
userid=rs("userid")
rs.close
set rs=server.CreateObject("adodb.Recordset")
sql2="select * from diarytype"
Rs.Open Sql2,conn,1,3
Rs.addnew
rs("type")="我的日记"
rs("userid")=userid
rs.update
rs.close
set rs=nothing
set sql2=nothing
booktotal=booktotal0+1'注册成功后总数

If ishtml="yes" Then
rb=booktotal Mod diarylistno
rb0=booktotal0 Mod diarylistno
File = diarydir&"m\newbook.htm"
rijibody=LoadFile(File)
rijibody=booklistre(rijibody)
FileName = "newbook.htm"
FilePath = diarydir&sitelistdir&"\"&FileName
SaveToFile rijibody,FilePath
FilePath = diarydir&sitelistdir&"\"&"newbook_"&(Int(booktotal0/diarylistno)+1)&".htm"
SaveToFile rijibody,FilePath
If rb0=0 Then
File = diarydir&"m\newbook.htm"
rijibody=LoadFile(File)
rijibody=booklistre0(rijibody,booktotal)
FileName = "newbook_"&Int(booktotal0/diarylistno)&".htm"
FilePath = diarydir&sitelistdir&"\"&FileName
SaveToFile rijibody,FilePath
End if
End if

response.Redirect("reg2.asp?action=ok&username="&username)
end if
end if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>心情日记本·分享你我的心情</title>
<meta name="keywords" content="免费,日记,心情日记,网络日记,免费日记,隐私日记,交换日记,粉可爱留言本、日记本申请">
<link href="<%=alltubg%>css.css" rel="stylesheet" type="text/css">
<script src="<%=alltubg%>alt.js"></script>
<script language="JavaScript">
 function IsChar(s)
{ 
 var username = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_";
 for (i = 0; i < s.length;i++)
    {
        var c = s.charAt(i);
        if (username.indexOf(c) == -1) return false;
    }
 return true;
}
function CheckForm()
{
    if (document.regform.username.value.length <3 || document.regform.username.value.length >18) {
		alert("用户名必须大于3个字符或小于18个字符.");
		document.regform.username.focus();
		return false;
	}
	 if (!IsChar(document.regform.username.value)){
        alert("用户名只能输入英文及数字，请不要输入中文及其他字符！");
  		document.regform.username.focus();
		return false;
}
    if (document.regform.shuyu.value.length <2 || document.regform.shuyu.value.length >70) {
		alert("日记首语不要多于五十位.");
		document.regform.shuyu.focus();
		return false;
	} 
	
    if (document.regform.password.value.length == 0) {
		alert("请输入你的密码.");
		document.regform.password.focus();
		return false;
	}

    if (document.regform.password.value != document.regform.password2.value) {
		alert("两次输入密码不相同.");
		document.regform.password.focus();
		return false;
	}
	
	if (document.regform.bookname.value.length ==0) {
		alert("请输日记本名.");
		document.regform.bookname.focus();
		return false;
	}
	
	if (document.regform.qq.value.length == 0) {
		alert("请输入QQ号码.");
		document.regform.qq.focus();
		return false;
	}
	if (document.regform.gongao.value.length <2 || document.regform.gongao.value.length >60) {
		alert("日记公告:不要多于五十位.");
		document.regform.gongao.focus();
		return false;
	} 
}
</script>
<script language="javascript">
	function SwitchCover(nCover,nBookID,sImageType)
	{
		if(nCover==-1)
			regform.preview.src=""+nBookID+"."+sImageType
		else
			regform.preview.src="../diary/"+nCover+""
	}
	function UploadCover(sPath)
	{
		preview.src=sPath
	}
	function SetCurrentCover(nCover)
	{
		bookcover=document.all("bookcover")
		for(var i=0;i<bookcover.options.length;i++)
		{
			if(bookcover(i).value==nCover)
			{
				bookcover(i).selected=true;
				return;
			}
		}
	}
	
</script>
</head>
<body background="<%=bgrnd%>" topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0" marginwidth="0">
<%if request.QueryString("action")="ok" then
username=request.QueryString("username")
okstring="<p>　</p><p>　</p><p>　</p><p>　</p><p>　</p><div align=center><font color=#FFFFFF>"&username&",恭喜你！你已经成功注册了心情日记本!<br><br></font><br><br><a href='/index.asp'><font color=#FFFFFF>返回首页</font></a></div>"
okstring=okstring+"<br><br><div align=center><font color=#FFFFFF>请到日记本首页登陆添加、管理你的日记！！<br></font></div>"
response.Write(okstring)
else%><form name="regform" method="post" action="reg2.asp?ation=reg" onSubmit="return CheckForm()">
<table width="985" border="0" cellspacing="0" cellpadding="0" align="center" style="margin:0 auto;">
  <tr> 
    <td> <!--#include file="head.asp" -->
      <table width="985" border="0" cellspacing="0" cellpadding="0" height="452">
        <tr> 
          <td width="20">&nbsp;</td>
          <td height="452" background="<%=alltubg%>bg1.gif" width="703"> 
            <table width="703" border="0" cellspacing="0" cellpadding="0" height="452">
              <tr> 
                <td height="5" width="56"></td>
                <td width="288"></td>
                <td rowspan="3" width="21"></td>
                <td width="284"></td>
                <td width="57"></td>
              </tr>
              <tr> 
                <td height="380" width="56">&nbsp;</td>
                <td width="288">
                  <table border="0" width="100%" id="table6" cellspacing="0" cellpadding="0" height="100%">
                    <tr> 
                      <td height="60">&nbsp; <img border="0" src="<%=alltubg%>reg2.gif" width="252" height="60"></td>
                    </tr>
                    <tr> 
                      <td height="208"> 
                        <p align="center"> <img id="preview" src="<%=alltubg%>img/01.jpg" width="271" height="209">
                      </td>
                    </tr>
                    <tr>
                        <td height="19">&nbsp;<font color="#774212"> <b>日记首语:</b></font></td>
                      
                    </tr>
                    <tr> 
                      <td> 
                        <p align="center"> 
<textarea id="shuyu"  name="shuyu" cols="35" rows="4">暂未修改</textarea>
                      </td>
                    </tr>
                  </table>
                </td>
                <td>
            <table border="0" width="284" id="table8" cellspacing="0" cellpadding="0" height="366">
              <tr> 
                <td width="19">　</td>
                <td width="74">　</td>
                <td width="191"> 　</td>
              </tr>
              <tr> 
                <td width="19" height="20">　</td>
                <td width="74"><b><font color="#77520A">注册账户:</font></b></td>
                <td width="191"> 
<input name="username" type="text" id="username" size="18" maxlength="10">
                  <font color="#FF0000">*3到18位</font></td>
              </tr>
              <tr> 
                <td width="19" height="20">&nbsp;</td>
                <td colspan="2"><font color="#333333">注册限制字符:</font><font color="#FF0000">#?@=&amp;,&lt;&gt;;*'&quot;()[]{}/\!<font color="#333333">以及</font>空格</font></td>
              </tr>
              <tr> 
                <td width="19" height="20">　</td>
                <td width="74"><b><font color="#77520A">用户性别:</font></b></td>
                <td width="191"> &nbsp;男生&nbsp; 
                  <input name="sex" type="radio" value="boy" checked>
                  &nbsp; 女士 
                  <input type="radio" name="sex" value="girl">
                </td>
              </tr>
              <tr> 
                <td width="19" height="20">　</td>
                <td width="74"><font color="#77520A"><b>用户密码:</b></font></td>
                <td width="191"> 
                  <input name="password" type="password" id="password" size="18" maxlength="12">
                  <font color="#FF0000">*6到12位</font></td>
              </tr>
              <tr> 
                <td width="19">　</td>
                <td width="74"><font color="#77520A"><b>重输密码:</b></font></td>
                <td width="191"> 
                  <input name="password2" type="password" id="password2" size="18" maxlength="12">
                </td>
              </tr>
              <tr> 
                <td width="19" height="20">　</td>
                <td width="74"><b><font color="#77520A">日记本名:</font></b></td>
                <td width="191"> 
                  <input name="bookname" type="text" id="username4" size="18" maxlength="10">
                  <font color="#FF0000">*不超过12位</font></td>
              </tr>

              <tr> 
                <td width="19" height="20">　</td>
                <td width="74"><font color="#77520A"><b>扣扣号码:</b></font></td>
                <td width="191"> 
                  <input name="qq" type="text" id="qq" size="18" maxlength="12">QQ号码
                </td>
              </tr>
              <tr> 
                <td width="19" height="20">　</td>
                <td width="74"><b><font color="#77520A">日记封面:</font></b></td>
                <td width="191"> 
                  <select name="fenmian" class="input" id="fenmian" style="width:120px" onChange="SwitchCover(this.value,6913,'jpg')">
                    <option value="img/01.jpg">图 片 1</option>
                    <option value="img/02.jpg">图 片 2</option>
                    <option value="img/03.jpg">图 片 3</option>
                    <option value="img/04.jpg">图 片 4</option>
                    <option value="img/05.jpg">图 片 5</option>
                    <option value="img/06.jpg">图 片 6</option>
                    <option value="img/07.jpg">图 片 7</option>
                    <option value="img/08.jpg">图 片 8</option>
                    <option value="img/09.jpg">图 片 9</option>
                    <option value="img/10.jpg">图 片 10</option>
                    <option value="img/11.jpg">图 片 11</option>
                    <option value="img/12.jpg">图 片 12</option>
                    <option value="img/13.jpg">图 片 13</option>
                    <option value="img/14.jpg">图 片 14</option>
                    <option value="img/15.jpg">图 片 15</option>
                    <option value="img/16.jpg">图 片 16</option>
                    <option value="img/17.jpg">图 片 17</option>
                    <option value="img/18.jpg">图 片 18</option>
                    <option value="img/19.jpg">图 片 19</option>
                    <option value="img/20.jpg">图 片 20</option>
                    <option value="img/21.jpg">图 片 21</option>
                    <option value="img/22.jpg">图 片 22</option>
                    <option value="img/23.jpg">图 片 23</option>
                    <option value="img/24.jpg">图 片 24</option>
                    <option value="img/25.jpg">图 片 25</option>
                    <option value="img/26.jpg">图 片 26</option>
                    <option value="img/27.jpg">图 片 27</option>
                    <option value="img/28.jpg">图 片 28</option>
                    <option value="img/29.jpg">图 片 29</option>
                    <option value="img/30.jpg">图 片 30</option>
                    <option value="img/31.jpg">图 片 31</option>
                    <option value="img/32.jpg">图 片 32</option>
                    <option value="img/33.jpg">图 片 33</option>
                    <option value="img/34.jpg">图 片 34</option>
                    <option value="img/35.jpg">图 片 35</option>
                    <option value="img/36.jpg">图 片 36</option>
                  </select>
                  <font color="#77520A">浏览全部</font></td>
              </tr>
			                <tr> 
                <td width="19" height="20">&nbsp;</td>
                <td colspan="2"><font color="#77520A"><b>个性说明:</b></font><font color="#FF0000">*不超过52位</font> 
                </td>
              </tr>
              <tr> 
                <td width="19">　</td>
                <td colspan="2">
                  <textarea name="url" id="username3" cols="35" rows="3">写自己的日记 让别人后悔去</textarea>
                </td>
              </tr>
              <tr> 
                <td width="19" height="20">　</td>
                <td colspan="2" valign="bottom"><b><font color="#77520A">日记公告:</font></b><font color="#FF0000">*不超过60位</font> 
                </td>
              </tr>
              <tr> 
                <td width="19">　</td>
                <td colspan="2">
                  <textarea rows="3" name="gongao" cols="35">暂无内容</textarea>
                </td>
              </tr>
              <tr> 
                <td colspan="3"> 
                  <p align="center"> 
                    <input type="image" src="<%=alltubg%>zc.gif" name="Submit" value=" 提 交 ">
                    &nbsp;&nbsp; <a href="/"> <img border="0" src="<%=alltubg%>fq.gif" width="50" height="23"></a> 
                </td>
              </tr>
            </table>
                </td>
                <td>&nbsp;</td>
              </tr>
              <tr> 
                <td height="67">&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
            </table>
          </td>
          <td width="272"> 
            <!--#include file="right.asp" -->
          </td>
        </tr>
      </table>
      <!--#include file="bottom.asp" -->
    </td>
  </tr>
  <tr> 
    <td></td>
  </tr>
</table></form>
</body>
</html>
<%end if%></html>
<%
end sub
sub sorry
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>日记·分享你我的心情</title>
<meta name="keywords" content="日记,日记,日记,日记,日记,免费,免费,免费,免费,日记,心情日记,网络日记,免费日记,隐私日记,交换日记,粉可爱留言本、日记本申请">
<link href="<%=alltubg%>css.css" rel="stylesheet" type="text/css">
<script src="<%=alltubg%>alt.js"></script>
</head>
<body background="<%=alltubg%>index_bg.jpg" topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0" marginwidth="0">
<table border="0" width="985" id="table1" cellspacing="0" cellpadding="0">
  <tr> 
    <td width="359"> <img border="0" src="<%=alltubg%>diary_1_1.jpg" width="359" height="79"></td>
    <td width="305"> <img border="0" src="<%=alltubg%>diary_1_2.jpg" width="305" height="79"></td>
    <td width="321"> <img border="0" src="<%=alltubg%>diary_1_3.jpg" width="321" height="79"></td>
  </tr>
</table>
<table border="0" width="985" id="table2" cellspacing="0" cellpadding="0">
  <tr> 
    <td valign="top" width="71" height="0" rowspan="2"> <img border="0" src="<%=alltubg%>diary_1.jpg" width="71" height="370"></td>
    <td width="288" background="<%=alltubg%>diary_2.jpg" rowspan="2">\<img border="0" src="<%=alltubg%>end_img.jpg" width="280" height="352"></td>
    <td width="21" rowspan="2"> <img border="0" src="<%=alltubg%>diary_3.jpg" width="21" height="370"></td>
    <td width="284" background="<%=alltubg%>diary_4.jpg" rowspan="2"> 
      <p align="center"><strong>Sorry...</strong></p>
      <p align="center">申请的人太多，<br>
        心情日记本·分享你我的心情实在没有空间提供了，<br>
        SO停止新用户的申请，<br>
        感谢大家的厚爱。</p>
      <p align="center">欢迎访问 <a style="color: #333333; text-decoration: none; border-bottom: 1px dotted" href="http://www.95886.com">｛ 
        心情日记本·分享你我的心情 ｝</a></p>
    </td>
    <td width="77" rowspan="2"> <img border="0" src="<%=alltubg%>diary_5_1.jpg" width="77" height="370"></td>
    <td width="194" height="87" background="<%=alltubg%>diary_5_2.jpg"> <font color="#FF3300">欢迎光临心情日记本·分享你我的心情</font></td>
    <td width="50" rowspan="2"> <img border="0" src="<%=alltubg%>diary_5_4.jpg" width="50" height="370"></td>
  </tr>
  <tr> 
    <td width="194" height="283"> <img border="0" src="<%=alltubg%>diary_5_3.jpg" width="194" height="283"></td>
  </tr>
</table>
<table border="0" width="100%" id="table3" cellspacing="0" cellpadding="0">
  <tr> 
    <td><img border="0" src="<%=alltubg%>diary_dow.jpg" width="985" height="71"></td>
  </tr>
</table>
<table border="0" width="985" id="table4" cellspacing="0" cellpadding="0">
  <tr> 
    <td width="271"> <img border="0" src="<%=alltubg%>diary_end_1.jpg" width="271" height="80"></td>
    <td width="518" background="<%=alltubg%>diary_end_2.jpg"> 
      <table border="0" width="100%" id="table5" cellspacing="0" cellpadding="0" height="49">
        <tr> 
          <td>
            <% call linkdow %>
          </td>
        </tr>
        <tr> 
          <td height="19">　</td>
        </tr>
      </table>
    </td>
    <td width="197"> <img border="0" src="<%=alltubg%>diary_end_3.jpg" width="197" height="80"></td>
  </tr>
</table>
</body>
</html>
<%
end sub
%>

