<?
require"ygl.php";
if($ygl_method=="reguser_1")
   {
   if (empty($user_new_id))
         {
         errorview("请认真填写好必需要填的资料！！");
         exit;
         }
   if(!ereg("^[0-9a-zA-Z_]{3,20}$",$user_new_id)){errorview("输入用户帐号错误,请重新输入！！");exit;}
   if(file_exists("user/$user_new_id.php")){errorview("对不起，该用户帐号已被别人注册! 换一个吧！");exit;}
 }
if($ygl_method=="reguser")
         {
         if (empty($user_id)||empty($username)||empty($userpass1)||empty($userpass2))
         {
         errorview("请认真填写好必需要填的资料！！");
         exit;
         }
         if(!ereg("^[0-9a-zA-Z_]{3,20}$",$user_id)){errorview("输入用户帐号错误,请重新输入！！");exit;}
         if(file_exists("user/$user_id.php")){errorview("对不起，该用户帐号已被别人注册! 换一个吧！");exit;}
         if($userpass1!=$userpass2){errorview("所填的两个密码不同！！");exit;}
         if(!ereg("^[0-9a-zA-Z_]{3,16}$",$userpass1)){errorview("密码必须为为英文字母或数字，长度6~16之内！！");exit;}
         if(!ereg("^[0-9a-zA-Z_]{3,16}$",$userpass2)){errorview("密码必须为为英文字母或数字，长度6~16之内！！");exit;}
         if($useryear=="19"){errorview("出生年份错误！！");exit;}
         if($usersex=="请选择"){errorview("请选择性别！！");exit;}
         if($userblood=="请选择")$userblood="";
         if($userfrom=="请选择"){errorview("请选择籍贯！！");exit;}
         if(!empty($userhobby)&&strlen($userhobby)>50){errorview("您的所填写的爱好不能大于25个汉字！");exit;}
         if(!empty($useroicq)&&!ereg("^[0-9]{5,16}$",$useroicq)){errorview("QQ号码不对啊，请认真填写！！");}
         if(!empty($usericq))if(!ereg("^[0-9]{5,18}$",$usericq)){errorview("ICQ号码不对啊，请认真填写！！");exit;}
         if(!empty($usermail))if(!ereg(".*\@.*\..*",$usermail)){errorview("您的Email输入错误！");exit;}
         if(!empty($usermobi))if(!ereg("^[0-9-]{11,15}$",$usermobi)){errorview("手机号码不对，请认真填写！！");exit;}
         if(!empty($usertel))if(!ereg("^[0-9-]{6,15}$",$usertel)){errorview("住址电话号码不对，请认真填写！！");exit;}
         if(!empty($useraddr))if(strlen($useraddr)>100){errorview("住址不能大于50个汉字！");exit;}
         if(!empty($usercode))if(!ereg("^[0-9-]{6,6}$",$usercode)){errorview("邮编错误！！");exit;}
         if(!empty($userly))if(strlen($userly) > 200){errorview("您的简短留言不能大于100个汉字！");exit;}
         $username=safe_cover($username);
         $userpass1=safe_cover($userpass1);
         $userpass2=safe_cover($userpass2);
         $useryear=safe_cover($useryear);
         $usermonth=safe_cover($usermonth);
         $userday=safe_cover($userday);
         $usersex=safe_cover($usersex);
         $userblood=safe_cover($userblood);
         $userfrom=safe_cover($userfrom);
         $userhobby=safe_cover($userhobby);
         $useroicq=safe_cover($useroicq);
         $usericq=safe_cover($usericq);
         $usermail=safe_cover($usermail);
         $usermobi=safe_cover($usermobi);
         $usertel=safe_cover($usertel);
         $userpage=safe_cover($userpage);
         $useraddr=safe_cover($useraddr);
         $usercode=safe_cover($usercode);
         $userly=safe_cover($userly);
         $userdate=date("Y")."/".date("n")."/".date("j")."/".date("G").":".date("i");
         $userborn=$useryear."年".$usermonth."月".$userday."日";
         $birth=$useryear."/".$usermonth."/".$userday;
                if($birth=str_replace("/","/",$birth));
                   {
                   list($biryear,$birmon,$birday)=split('\/',$birth);
                   $birday=($birday*10)/10;
                   if($birday<10){
                   $startmp=$birmon."0".$birday;
                   }
                   else{
                   $startmp=$birmon.$birday;
                   }
                    if (($startmp>=120)&&($startmp<=218))$star="水瓶座";
                    if (($startmp>=219)&&($startmp<=320))$star="双鱼座";
                    if (($startmp>=321)&&($startmp<=419))$star="白羊座";
                    if (($startmp>=420)&&($startmp<=520))$star="金牛座";
                    if (($startmp>=521)&&($startmp<=621))$star="双子座";
                    if (($startmp>=622)&&($startmp<=722))$star="巨蟹座";
                    if (($startmp>=723)&&($startmp<=822))$star="狮子座";
                    if (($startmp>=823)&&($startmp<=922))$star="处女座";
                    if (($startmp>=923)&&($startmp<=1022))$star="天秤座";
                    if (($startmp>=1023)&&($startmp<=1121))$star="天蝎座";
                    if (($startmp>=1122)&&($startmp<=1221))$star="射手座";
                    if (($startmp>=1222)||($startmp<=119))$star="摩羯座";
                   }
         $fp=fopen("user/$user_id.php","a+") or die("file open error");
         $oo="<?";
         $user=$oo."\t".$user_id."\t".$username."\t".$userpass1."\t".$birth."\t".$star."\t".$usersex."\t".$userblood."\t".$userfrom."\t".$userhobby."\t".$userpage."\t".$useroicq."\t".$usericq."\t".$usermail."\t".$usermobi."\t".$usertel."\t".$useraddr."\t".$usercode."\t".$userly."\t".$userdate."\n";
         fwrite($fp,$user);
         fclose($fp);
         $workaddr="未知";
         $fpcard=fopen("user/$user_id.crd","w+");
         $usercard=$user_id."\t".$username."\t".$workaddr."\t".$usertel."\t".$usermobi."\t".$usermail."\n";
         fwrite($fpcard,$usercard);
         fclose($fpcard);
         /*$TMP = fopen("user/list", "a+") or die("file open error");
         fwrite($TMP, "$user_id\n");
         fclose($TMP);*/
         if(!file_exists("user/list"))
         fopen("user/list","a+");
         if(!file_exists("count/oncount.php"))
         fopen("count/oncount.php","a+");
         if(!file_exists("class/classlist.php"))
         fopen("class/classlist.php","a+");
         $oldlist=read_file("user/list");
                                $oldlist=explode("\n",$oldlist);
                                $oldlist=implode("\n",$oldlist);
                                $new_line=$user_id;
                                $newlist=$new_line."\n".$oldlist;
                                write_file("user/list",$newlist);
         $fp2=fopen("count/$user_id.php","w+");
         fwrite($fp2,"");
         fclose($fp2);
         $fp3=fopen("user/$user_id.cla","w+");
         fwrite($fp3,"");
         fclose($fp3);
         $fp4=fopen("favorites/$user_id.php","w+");
         fwrite($fp4,"");
         fclose($fp4);
         print <<<EOT
         <html>
<head>
<title>注册成功！！</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style>
<!--
a:link{text-decoration:none;color:#000000;font-size:9pt}
a:active{text-decoration:none;font-size:9pt}
a:visited{text-decoration:none;color:#004080;font-size:9pt}
a:hover{text-decoration:underline;color:#ff0000;font-size:9pt}
br,td,p,div,body,input,form {font-size:9pt;color:#000000;font-family:宋体,Arial}

-->
</style>
</head>
<body bgcolor="#FFFFFF" text="#000000" background="bgs.jpg">
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<table width="450" border="1" cellpadding="4" cellspacing="0"  bordercolorlight="#B5E1F7" bordercolordark="#FFFFFF" align="center">
<tr><td colspan="3" bgcolor="#B5E1F7">
      <div align="center"><b><font color="#003399">用 户 注 册 成 功</font></b></div>
    </td>
  </tr>
  <tr>
    <td colspan="3" height="46"> 　　以下是你的注册资料，同时你的注册邮箱也会收到一封注册成功的通知邮件。如有错误，请进入修改资料处调整一下。</td>
  </tr>
  <tr>
    <td width="19%">
      <div align="center">用户帐号：</div>
    </td>
    <td width="54%">$user_id</td>
    <td width="27%">
      <div align="center"><font color="#009900">永久帐号，不能修改</font></div>
    </td>
  </tr>
  <tr>
    <td width="19%">
      <div align="center">真实姓名：</div>
    </td>
    <td width="54%">$username</td>
    <td width="27%"><font color="#009900">这是你的真实姓名吗</font></td>
  </tr>
  <tr>
    <td width="19%">
      <div align="center">出生：</div>
    </td>
    <td width="54%">$userborn</td>
    <td width="27%"><font color="#009900">我2月30号出生^o^</font></td>
  </tr>
  <tr>
    <td width="19%">
      <div align="center">性别：</div>
    </td>
    <td width="54%">$usersex</td>
    <td width="27%"><font color="#009900">好在不是非男非女</font></td>
  </tr>
  <tr>
    <td width="19%">
      <div align="center">血型：</div>
    </td>
    <td width="54%">$userblood &nbsp;</td>
    <td width="27%"><font color="#009900">我 K 型的！</font></td>
  </tr>
  <tr>
    <td width="19%">
      <div align="center">籍贯：</div>
    </td>
    <td width="54%">$userfrom</td>
    <td width="27%"><font color="#009900">哎~~想不出要讲什么</font></td>
  </tr>
  <tr>
    <td width="19%">
      <div align="center">爱好：</div>
    </td>
    <td width="54%">$userhobby&nbsp;</td>
    <td width="27%"><font color="#009900">不要说你没有！</font></td>
  </tr>
  <tr>
    <td width="19%">
      <div align="center">个人主页：</div>
    </td>
    <td width="54%">$userpage&nbsp;</td>
    <td width="27%"><font color="#009900">无的快学啦！</font></td>
  </tr>
  <tr>
    <td width="19%">
      <div align="center">OICQ：</div>
    </td>
    <td width="54%">$useroicq&nbsp;</td>
    <td width="27%"><font color="#009900">我的是4位数9394^_^</font></td>
  </tr>
  <tr>
    <td width="19%">
      <div align="center">ICQ：</div>
    </td>
    <td width="54%">$usericq&nbsp;</td>
    <td width="27%"><font color="#009900">我不玩ICQ的！</font></td>
  </tr>
  <tr>
    <td width="19%">
      <div align="center">E-Mail：</div>
    </td>
    <td width="54%">$usermail&nbsp;</td>
    <td width="27%"><font color="#009900">忘记密码时须要用的</font></td>
  </tr>
  <tr>
    <td width="19%">
      <div align="center">手机：</div>
    </td>
    <td width="54%">$usermobi&nbsp;</td>
    <td width="27%"><font color="#009900">13828888888好吗？</font></td>
  </tr>
  <tr>
    <td width="19%">
      <div align="center">住址电话：</div>
    </td>
    <td width="54%">$usertel&nbsp;</td>
    <td width="27%"><font color="#009900">记住啦，是110啊</font></td>
  </tr>
  <tr>
    <td width="19%">
      <div align="center">住址：</div>
    </td>
    <td width="54%">$useraddr&nbsp;</td>
    <td width="27%"><font color="#009900">你不是流民吧</font></td>
  </tr>
  <tr>
    <td width="19%">
      <div align="center">邮编：</div>
    </td>
    <td width="54%">$usercode&nbsp;</td>
    <td width="27%"><font color="#009900">不要说没有啊</font></td>
  </tr>
  <tr>
    <td width="19%">
      <div align="center">简短留言：</div>
    </td>
    <td colspan="2">$userly&nbsp;</td>
  </tr>
  <tr>
    <td colspan="3" align=center><a href=index.php>返回首页</a></td>
  </tr>
</table>
<p>&nbsp;</p>
<p>&nbsp;</p>
<table width="750" border="0" cellspacing="0" cellpadding="3" align="center">
  <tr>
    <td>
      <hr noshade color=#6BC5EF>
    </td>
  </tr>
  <tr>
    <td>
      <div align="center">时尚同学录　　本同学录由<a href=mailto:kygl@163.com>阿收</a>制作<br>
        Copyright&copy; 2002 Powered By <a href="http://sspc.yeah.net" target="_blank">ShiShang
        Studio</a>.</div>
    </td>
  </tr>
</table>
</body>
</html>
EOT;
exit;}
if(empty($user_new_id))exit;
$title="新用户注册";
include"header.php";
?>
<form method=post action="reg.php" enctype=multipart/form-data>
<table width="500" border="0" cellspacing="2" cellpadding="2" align=center>
        <tr>
          <td>欢迎您！<?echo $user_new_id;?><br>
            &nbsp;&nbsp;&nbsp;&nbsp;为了方便您的同学联系您，请认真填写下面的个人信息，带<font color=red>*</font>的为必填信息。</td>
        </tr>
      </table>
<table width="423" border="0" cellspacing="2" cellpadding="2" align="center">
    <tr><td colspan="2">
      <input type="hidden" name="ygl_method" value="reguser" class=text>
        <div align="center"><b><font color="#0099FF" size="5">用户注册</font></b><font color=red>（带*号的必填！）</font></div>
      </td>
    </tr>
    <tr><td  align=center bgcolor="#eeeeee">用户帐号:</td><td bgcolor="#eeeeee"><?echo $user_new_id;?><input type="hidden" name="user_id" value="<?echo $user_new_id;?>"><font color=red>*(不能修改，若要修改请按这里<a href="javascript:history.back(1)">返回</a>)</font></td></tr>
     <tr>
      <td width="77">
        <div align="center">密码：</div>
      </td>
      <td width="332">
        <input type="password" name="userpass1" size="16" class=text><font color=red>*(必须为英文或数字,长度在3~16之间)</font>
      </td>
    </tr>
    <tr>
      <td width="77" bgcolor="#eeeeee">
        <div align="center">确认密码：</div>
      </td>
      <td width="332" bgcolor="#eeeeee">
        <input type="password" name="userpass2" size="16" class=text><font color=red>*(必须为英文或数字,长度在3~16之间)</font>
      </td>
    </tr><tr>
      <td colspan="2">
        <div align="center"><b>个人真实资料</b></div>
      </td></tr> <tr><td width="77" bgcolor="#eeeeee">
        <div align="center">真实姓名：</div>
      </td>
      <td width="332" bgcolor="#eeeeee">
        <input name="username" size="16" class=text><font color=red>*</font></font>
      </td>
    </tr>

    <tr>
      <td width="77">
        <div align="center">出生：</div>
      </td>
      <td width="332">
        <input type="text" name="useryear" maxlength="4" size="5" value="19" class=text>
        年
        <select name="usermonth">
          <option value="01">01</option>
          <option value="02">02</option>
          <option value="03">03</option>
          <option value="04">04</option>
          <option value="05">05</option>
          <option value="06">06</option>
          <option value="07">07</option>
          <option value="08">08</option>
          <option value="09">09</option>
          <option value="10">10</option>
          <option value="11">11</option>
          <option value="12">12</option>
        </select>
        月
        <select name="userday">
          <option value="01">01</option>
          <option value="02">02</option>
          <option value="03">03</option>
          <option value="04">04</option>
          <option value="05">05</option>
          <option value="06">06</option>
          <option value="07">07</option>
          <option value="08">08</option>
          <option value="09">09</option>
          <option value="10">10</option>
          <option value="11">11</option>
          <option value="12">12</option>
          <option value="13">13</option>
          <option value="14">14</option>
          <option value="15">15</option>
          <option value="16">16</option>
          <option value="17">17</option>
          <option value="18">18</option>
          <option value="19">19</option>
          <option value="20">20</option>
          <option value="21">21</option>
          <option value="22">22</option>
          <option value="23">23</option>
          <option value="24">24</option>
          <option value="25">25</option>
          <option value="26">26</option>
          <option value="27">27</option>
          <option value="28">28</option>
          <option value="29">29</option>
          <option value="30">30</option>
          <option value="31">31</option>
        </select>
        日 <font color=red>*</font></td>
    </tr>
    <tr>
      <td width="77" bgcolor="#eeeeee">
        <div align="center">性别：</div>
      </td>
      <td width="332" bgcolor="#eeeeee">
        <select name="usersex">
          <option>请选择</option>
          <option value="男">男</option>
          <option value="女">女</option>
        </select><font color=red>*</font>
      </td>
    </tr>
    <tr>
      <td width="77">
        <div align="center">血型：</div>
      </td>
      <td width="332">
        <select name="userblood">
          <option value="请选择">请选择</option>
          <option value="A">A</option>
          <option value="B">B</option>
          <option value="AB">AB</option>
          <option value="O">O</option>
        </select>
        型 </td>
    </tr>
    <tr>
      <td width="77" bgcolor="#eeeeee">
        <div align="center">籍贯：</div>
      </td>
      <td width="332" bgcolor="#eeeeee"><font color="#800000">
        <select name=userfrom size=1>
          <option>请选择</option>
          <option VALUE="北京">北京</option>
          <option VALUE="安徽">安徽</option>
          <option VALUE="重庆">重庆</option>
          <option VALUE="福建">福建</option>
          <option VALUE="甘肃">甘肃</option>
          <option VALUE="广东">广东</option>
          <option VALUE="广西">广西</option>
          <option VALUE="贵州">贵州</option>
          <option VALUE="海南">海南</option>
          <option VALUE="河北">河北</option>
          <option VALUE="黑龙江">黑龙江</option>
          <option VALUE="河南">河南</option>
          <option VALUE="湖北">湖北</option>
          <option VALUE="湖南">湖南</option>
          <option VALUE="内蒙古">内蒙古</option>
          <option VALUE="江苏">江苏</option>
          <option VALUE="江西">江西</option>
          <option VALUE="吉林">吉林</option>
          <option VALUE="辽宁">辽宁</option>
          <option VALUE="宁夏">宁夏</option>
          <option VALUE="青海">青海</option>
          <option VALUE="山西">山西</option>
          <option VALUE="陕西">陕西</option>
          <option VALUE="山东">山东</option>
          <option VALUE="上海">上海</option>
          <option VALUE="四川">四川</option>
          <option VALUE="天津">天津</option>
          <option VALUE="西藏">西藏</option>
          <option VALUE="新疆">新疆</option>
          <option VALUE="云南">云南</option>
          <option VALUE="浙江">浙江</option>
          <option VALUE="其它">其他</option>
        </select>
        </font><font color=red>*</font></td>
    </tr>
    <tr>
      <td width="77">
        <div align="center">爱好：</div>
      </td>
      <td width="332">
        <input type="text" name="userhobby" class=text>
      </td>
    </tr>
    <tr bgcolor="#eeeeee">
      <td>
        <div align="center">个人主页：</div>
      </td>
      <td>
        <input type="text" name="userpage" class=text>
      </td>
    </tr>
    <tr>
      <td colspan="2">
        <div align="center"><b><font color="#800000"> </font></b></div>
      </td>
    </tr>
    <tr>
      <td colspan="2">
        <div align="center"><b>联系资料</b></div>
      </td>
    </tr>
    <tr>
      <td width="77" bgcolor="#eeeeee">
        <div align="center">OICQ：</div>
      </td>
      <td width="332" bgcolor="#eeeeee">
        <input type="text" name="useroicq" size="16" class=text><font color=red>必需为数字</font>
      </td>
    </tr>
    <tr>
      <td width="77">
        <div align="center">ICQ：</div>
      </td>
      <td width="332">
        <input type="text" name="usericq" size="16" class=text><font color=red>必需为数字</font>
      </td>
    </tr>
    <tr>
      <td width="77" bgcolor="#eeeeee">
        <div align="center">E-Mail：</div>
      </td>
      <td width="332" bgcolor="#eeeeee">
        <input type="text" name="usermail" size="20" class=text>
      </td>
    </tr>
    <tr>
      <td width="77">
        <div align="center">手机：</div>
      </td>
      <td width="332">
        <input type="text" name="usermobi" size="15" class=text><font color=red>必需为数字</font>
      </td>
    </tr>
    <tr>
      <td width="77" bgcolor="#eeeeee">
        <div align="center">住址电话：</div>
      </td>
      <td width="332" bgcolor="#eeeeee">
        <input type="text" name="usertel" size="15" class=text><font color=red>必需为数字</font>
      </td>
    </tr>
    <tr>
      <td width="77">
        <div align="center">住址：</div>
      </td>
      <td width="332">
        <input type="text" name="useraddr" class=text>
      </td>
    </tr>
    <tr>
      <td width="77" bgcolor="#eeeeee">
        <div align="center">邮编：</div>
      </td>
      <td width="332" bgcolor="#eeeeee">
        <input type="text" name="usercode" size="10" class=text>
      </td>
    </tr>
    <tr>
      <td colspan="2">&nbsp;</td>
    </tr>
    <tr>
      <td colspan="2">
        <div align="center"><b>简短留言</b></div>
      </td>
    </tr>
    <tr>
      <td colspan="2" bgcolor="#eeeeee">
        <div align="center">
          <textarea name="userly" cols="40" rows="5" class=text></textarea>
        </div>
      </td>
    </tr>
    <tr>
      <td width="77">&nbsp;</td>
      <td width="332">
        <input type="submit" value="提  交" name="botton" class=text>
        &nbsp;
        <input type="reset" value="重  写" name="reset" class=text>
      </td>
    </tr>
  </table>
</form>
<?include"footer.php";?>