<!--#include file="conn.asp"-->
<%tmp = "http://" & request.servervariables("SERVER_NAME") & _            
               left(request.servervariables("SCRIPT_NAME"),len(request.servervariables("SCRIPT_NAME"))-len("default.asp"))%>
  <%


  set rs=server.createobject("adodb.recordset")

sql="select * from user"
rs.open sql,conn,1,2
scount=INT(Rs.recordcount)%>

<html>
<head>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>[中泰科技]多用户留言板申请</title>

<link rel="stylesheet" type="text/css" href="style/2.css">
<script language="JavaScript">
<!--

function Juge(theForm)
{
  if (theForm.user.value == "")
  {
    alert("请输入您的用户名!");
    theForm.user.focus();
    return (false);
  }
	if (checktext(theForm.user.value))
	{
		alert("请您输入有效用户名!");
		theForm.user.select();
		theForm.user.focus();
		return (false);
	}


	if (theForm.pwd1.value == "")
  {
    alert("请输入您的密码!");
    theForm.pwd1.focus();
    return (false);
  }
  	if (theForm.pwd2.value == "")
  {
    alert("请输入您的确认密码!");
    theForm.pwd2.focus();
    return (false);
  }
	if (theForm.email.value == "")
	{
		alert("请您输入\"email\"!");
		theForm.email.focus();
		return (false);
	}
	if (theForm.web.value == "")
	{
		alert("请您输入您的站名");
		theForm.web.focus();
		return (false);
	}
	if (theForm.url.value == "")
	{
		alert("请您输入您的网站地址");
		theForm.url.focus();
		return (false);
	}
	if (theForm.zhanzhang.value == "")
	{
		alert("请您输入站长姓名!");
		theForm.zhanzhang.focus();
		return (false);
	}

	var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_@.";
	var checkStr = theForm.email.value;
	var allValid = true;
	for (i = 0;  i < checkStr.length;  i++)
	{
		ch = checkStr.charAt(i);
		for (j = 0;  j < checkOK.length;  j++)
		if (ch == checkOK.charAt(j))
			break;
		if (j == checkOK.length)
		{
			allValid = false;
			break;
		}
	}

	if (theForm.email.value.length < 6)
	{
			allValid = false;
	}

	if (!allValid)
	{
		alert("您输入的 \"电子邮件地址\" 无效!");
		theForm.email.focus();
		return (false);
	}

	address=theForm.email.value;
    if(address.length>0)
	{
        i=address.indexOf("@");
        if(i==-1)
		{
			window.alert("对不起！您输入的电子邮件地址是错误的！")
			theForm.email.focus();
			return false
        }
       ii=address.indexOf(".")
        if(ii==-1)
		{
			window.alert("对不起！您输入的电子邮件地址是错误的！")
			theForm.email.focus();
			return false
        }

    }
	if (checktext(theForm.email.value))
	{
		alert("请您输入有效的\"email\"!");
		theForm.email.select();
		theForm.email.focus();
		return (false);
	}
	
}


function checktext(text)
{
			allValid = true;

		for (i = 0;  i < text.length;  i++)
		{
			if (text.charAt(i) != " ")
			{
				allValid = false;
				break;
			}
		}

return allValid;
}

//-->
</script>
</head>

<body>
<table width="600" align="center" cellspacing="0" cellpadding="1"  border="0" bgcolor=#000000>
  <tr> 
    <td> 
      <table width="600" cellspacing="0" cellpadding="4" border="0" class="table002">
        <tr> 
          <td class="jnfont7" valign="middle" align=left> <b>>> </b> <a href="default.asp"><acronym title="返回主页">主页</acronym></a> 
            | <a href="modify.asp?user=<%=user%>"><acronym title="编辑你的个人资料">修改资料</acronym></a>    
            | <%if  adminok="ok" then%><a href="usermanager.asp?user=<%=user%>&exit=ok"><acronym title="退出管理">退出管理</acronym></a><%else%><a href="usermanager.asp?user=<%=user%>"><acronym title="回复或删除留言">留言管理</acronym></a><%end if%>    
            | <a href="default.asp"><acronym title="免费申请留言本">免费申请</acronym></a>    
            | <a href="top.asp"><acronym title="留言排行榜">留言排行</acronym></a>| <a href="check.asp"><acronym title="超级用户管理">超级用户</acronym></a> </td>   
          <td class="jnfont7" valign="middle" align=right><b><%=webname%></b></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<p>&nbsp;</p><div align="center">      
  <center>
  <table border="0" width="600" cellpadding="0" bgcolor="#000000" cellspacing="1" cellpadding="3">      
    <form action="reg.asp" method="POST" onSubmit="return Juge(this)">          
      <tr class="table001">          
        <td width="20%" align="right" class="jnfont6">用户名：</td>          
        <td width="80%">           
                <input type="text" name="user" size="20" maxlength="15" class="input1">          
                * 1-15个字节</td>                        
      </tr>                     
      <tr class="table001">                     
        <td width="20%" align="right" class="jnfont6">密码：</td>                      
        <td width="80%">                       
                <input type="password" name="pwd1" size="20" maxlength="15" class="input1">                      
                * 1-15个字节</td>                        
      </tr>                     
      <tr class="table001">                     
        <td width="20%" align="right" class="jnfont6">重复密码：</td>                     
        <td width="80%">                      
                <input type="password" name="pwd2" size="20" maxlength="15" class="input1">                     
                * 1-15个字节</td>                        
      </tr>                     
      <tr class="table001">                     
        <td width="20%" align="right" class="jnfont6">站长姓名：</td>                     
        <td width="80%">
                  <input type="text" size="20" maxlength="100" name="zhanzhang" class="input1">                     
          *</td>                          
      </tr>      
      <tr class="table001">                     
        <td width="20%" align="right" class="jnfont6">留言样式：</td>                     
        <td width="80%">
         <select name="kind" size="1">
<OPTION selected VALUE="1">金壁辉煌
<OPTION VALUE="2">粉红回忆
<OPTION VALUE="3">银灰世界
<OPTION VALUE="4">菁菁校园
<OPTION VALUE="5">白色如雪

</select>                      
          </td>                       
      </tr> 
      <tr class="table001">                     
        <td width="20%" align="right" class="jnfont6">E-mail：</td>                     
        <td width="80%"><input type="text" size="40" maxlength="50" name="email" value="@" class="input1">                     
          *</td>                          
      </tr>                       
      <tr class="table001">                       
        <td width="20%" align="right" class="jnfont6">站&nbsp; 名：</td>                        
        <td width="80%"><input type="text" size="40" maxlength="50" name="web" class="input1">                     
          *</td>                        
      </tr>                     
      <tr class="table001">                     
        <td width="20%" align="right" class="jnfont6">主页地址：</td>                     
        <td width="80%"><input type="text" name="url" size="40" maxlength="100" value="http://" class="input1">
          *</td>                        
      </tr>             
      <tr class="table001">                     
        <td width="20%" align="right" class="jnfont6">主页简介：</td>                    
        
        <td width="80%"><textarea cols="46" type="text" name="intro" rows="4" class="testarea1"></textarea>
                </td>                   
      </tr>                   
      <tr class="table003">                   
        <td width="20%" colspan="2" align="right">                   
          <p align="center"><input type="submit" value="写完了" class="input2">                    
          <input type="reset" value="重新写" name="reset" class="input2">                    
        </td>                   
      </tr>                   
      <tr class="table002">                 
                <td width="20%" colspan="2" align="center" class="jnfont6">共<b><%=scount%></b>个网站申请，您的留言本地址就是：<%=tmp%>guestbook.asp?user=<b>你的用户名</b> 
                </td>                
      </tr>          
      </form>              
    </table>      
  </center>          
</div>          
              
<div align="center">          
  <center>          
              
    <table border="0" width="560" cellpadding="0">
      <tr> 
        <td width="100%"> 
          <hr SIZE="1" width="80%">
        </td>
      </tr>
      <tr> 
        <td width="100%" class="jnfont6"> 
          <p align="center">
            <a href=http://www.5151.cn target=_blank>免费留言本由[中泰科技]提供</a>
        </td>
      </tr>
    </table>                                  
             
  </center>         
</div>         
       
</body>             
</html>             
<%rs.close
set rs=nothing%>

