reguse.inc.php处理注册用户时的信息
<?
function regok($mess,$reginfo) //记录成功后输出用户信息
{
echo "<table cellspacing='0' cellpadding='0' bgcolor='#000000'>";
echo "<tr><td><table cellspacing='1' cellpadding='1' bgcolor='#eeeeee'><tr bgcolor='#006699'><td colspan='4'><div><font color='ffffff'>".$mess."</font></div></td></tr>";
echo "<tr ><td ><div>ID号:</div></td><td><div><font color='#FF0000'>".$reginfo[13]."</font></div></td>";
echo "<td><div>用户:</div></td><td ><div><font color='#FF0000'>".$reginfo[0]."</div></td></tr>";
echo "<tr ><td><div>密码:</div></td><td><div><font color='#FF0000'>".$reginfo[1]."</font></div></td>";
echo "<td><div>主页:</div></td><td ><div><font color='#FF0000'>".$reginfo[9]."</div></td></tr>";
echo "<tr ><td><div>邮箱:</div></td><td><div><font color='#FF0000'>".$reginfo[8]."</font></div></td>";
echo "<td><div>oicq:</div></td><td><div><font color='#FF0000'>".$reginfo[3]."</div></td></tr>";
echo "<tr ><td><div>昵称:</div></td><td><div><font color='#FF0000'>".$reginfo[2]."</font></div></td>";
echo "<td><div>等级:</div></td><td><div><font color='#FF0000'>".$reginfo[11]."</div></td></tr>";
echo "<tr ><td><div>性别:</div></td><td><div><font color='#FF0000'>".$reginfo[4]."</font></div></td>";
echo "<td><div>年龄:</div></td><td><div><font color='#FF0000'>".$reginfo[5]."</div></td></tr>";
echo "<tr ><td><div>职业:</div></td><td><div><font color='#FF0000'>".$reginfo[6]."</font></div></td>";
echo "<td><div>来自:</div></td><td ><div><font color='#FF0000'>".$reginfo[7]."</div></td></tr>";
echo "<tr ><td><div>信息保密:</div></td><td><div><font color='#FF0000'>".$reginfo[12]."</font></div></td>";
echo "<td><div>签名:</div></td><td ><div><font color='#FF0000'>".$reginfo[10]."</div></td></tr>";
echo "<tr ><td><div>邮件通知:</div></td><td><div><font color='#FF0000'>".$reginfo[18]."</font></div></td>";
echo "<td><div>注册时间:</div></td><td ><div><font color='#FF0000'>".$reginfo[15]."</div></td></tr>";
echo "<tr ><td><div>登录时间:</div></td><td><div><font color='#FF0000'>".$reginfo[16]."</font></div></td>";
echo "<td><div>头像:</div></td><td ><div><img src='https://www.jb51.net/images/".$reginfo[14].".gif'></div></td></tr>";
$reginfo=$reginfo[0];
echo "<tr bgcolor='#006699'><td colspan='4'><div><a href='https://www.jb51.net/reguse.php?action=dl&use=".$reginfo."'>用户登录</a></div></td></tr>";
echo "</table></td></tr></table>";
}
//检查信息并写入记录
function reg($usename,$usepass,$usemail,$useweb,$useni,$useoicq,$usesex,$useage,$usezy,$useaddr,$useinf,$usety,$usebq,$useqm)
{
if ($usename) //如果有用户名传入则处理 用户注册模块
{
if(strlen($usename)>8) return 1;
else if(strlen($usepass)>8) return 2;
else if(strlen($useoicq)>12) return 3;
else if(!uinfo($usepass,pass)) return 4;
else if(!uinfo($usename,name)) return 5;
else if(!uinfo($useoicq,oicq)) return 6;
else if(!uinfo($usemail,mail)) return 7;
else
{
if(!$useinf) $useinf=2;
$query="select * from useinfo where usename='".$usename."'"; //是否已经存在用户
$req=mysql_query($query);
$useinfp=mysql_fetch_array($req);
if ($useinfp[0]) return 8;
else
{
$time=date(Y年n月j日G时i分);
$useqm=nl2br($useqm); //写入用户信息
$query="insert into useinfo (usename,usepass,usemail,useweb,useni,useoicq,usesex,useage,usezy,useaddr,useinf,usety,usebq,useqm,useattr,regdate,enddate) values ('".$usename."','".$usepass."','".$usemail."','".$useweb."','".$useni."','".$useoicq."','".$usesex."','".$useage."','".$usezy."','".$useaddr."','".$useinf."','".$usety."','".$usebq."','".$useqm."',1,now(),'".$time."')";
$req=mysql_query($query);
if ($req)
{
$query="select * from useinfo where usename='".$usename."'"; //取出用户信息,并传出用户端
$req=mysql_query($query);
$useinfo=mysql_fetch_array($req);
return $useinfo;
}
else return 10;
}
}
return 9;
}
}
function usemess($mess,$usename,$usemail,$useweb,$useni,$useoicq,$useaddr,$useqm) //信息输入表单
{
echo "<FORM METHOD=post>";
echo "<table cellspacing='0' cellpadding='0' bgcolor='#000000'>";
echo "<tr><td><table cellspacing='1' cellpadding='1'>";
echo "<tr bgcolor='#006699'><td colspan='2'><font color='ffffff'><div>狐网论坛用户注册---<font color='00ff00'>".$mess."</font></div></font></td></tr>";
echo "<tr bgcolor='#eeeeee'><td><div> 用 户 名:<font color='#FF0000'>八位,第一位必须是字母</FONT></div></td><td><input onFocus='this.select()' type='text' size='30' maxlength='8' value='".$usename."'></td></tr>";
echo "<tr bgcolor='#eeeeee'><td><div>密 码:<font color='#FF0000'>八位,数字和字母组合.</font></div></td><td><input type='password' size='30' maxlength='8'></td></tr>";
echo "<tr bgcolor='#eeeeee'><td><div>电子信箱:<font color='#FF0000'>请填写真实的邮箱地址。</font></div></td><td><input onFocus='this.select()' type='text' size='50' maxlength='50' value='".$usemail."'></td></tr>";
echo "<tr bgcolor='#eeeeee'><td><div>个人主页:</div></td><td><div><input onFocus='this.select()' type='text' size='50' maxlength='50' value='".$useweb."'></div></td></tr>";
echo "<tr bgcolor='#006699'><td colspan='2'><div><font color='#FFFFFF'>个人信息设定</font></div></td></tr>";
echo "<tr bgcolor='#eeeeee'><td><div>你的昵称:</div></td><td><div><input onFocus='this.select()' type='text' size='30' maxlength='15' value='".$useni."'></div></td></tr>";
echo "<tr bgcolor='#eeeeee'><td><div>OICQ:</div></td><td><div><input onFocus='this.select()' type='text' size='20' maxlength='20' value='".$useoicq."'></div></td></tr>";
echo "<tr bgcolor='#eeeeee'><td><div>性 别:</div></td><td><div><select onFocus='this.select()'><option value='1' selected>我是男生</option><option value='0'>我是女生</option></select></div></td></tr>";
echo "<tr bgcolor='#eeeeee'><td><div>年 龄:</div></td><td><div><select onFocus='this.select()'><option value='14'>15岁以下</option><option value='15'>15 岁</option><option value='16'>16 岁</option><option value='17'>17 岁</option>";
echo "<option value='18'>18 岁</option><option value='19'>19 岁</option><option value='20' selected>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></select></div></td></tr>";
echo "<tr bgcolor='#eeeeee'><td><div>职 业:</div></td><td><div><select onFocus='this.select()'><option value='5' selected>我是学生</option><option value='1'>公务员</option><option value='2'>公司雇员</option><option value='3'>自由职业</option><option value='4'>无所事事</option><option value='5'>不告诉你</option></select></div></td></tr>";
echo "<tr bgcolor='#eeeeee'><td><div>来自何方:</div></td><td><div><input onFocus='this.select()' type='text' size='50' maxlength='50' value='".$useaddr."'></div></td></tr>";
echo "<tr bgcolor='#006699'><td colspan='2'><div></div><div><font color='#FFFFFF'>参数设定</font></div></td></tr>";
echo "<tr bgcolor='#eeeeee'><td><div>是否充许他人查看你的信息:</div></td><td><div><input type='radio' value='2'>否 <input type='radio' value='1' checked>是</div></td></tr>";
echo "<tr bgcolor='#eeeeee'><td valign='top'><div>个人签名档:</div></td><td><div><textarea onFocus='this.select()' cols='40' wrap='VIRTUAL' rows='5'>".$useqm."</textarea></div></td></tr>";
echo "<tr bgcolor='#eeeeee'><td><div>是否允许版主或管理员给你发邮件通知:</div></td><td><div><input type='radio' value='2'>否 <input type='radio' value='1' checked>是</div></td></tr>";
echo "<tr bgcolor='#006699'><td colspan='2'><div><font color='#FFFFFF'>头像设定</font></div></td></tr>";
echo "<tr bgcolor='#eeeeee'><td colspan='2'><div><input type='radio' value='a'><img src='https://www.jb51.net/images/a.gif' checked> <input type='radio' value='1'><img src='https://www.jb51.net/images/1.gif'> <input type='radio' value='2'><img src='https://www.jb51.net/images/2.gif'> <input type='radio' value='3'><img src='https://www.jb51.net/images/3.gif'> <input type='radio' value='4'><img src='https://www.jb51.net/images/4.gif'> ";
echo "<input type='radio' value='5'><img src='https://www.jb51.net/images/5.gif'> <input type='radio' value='6'><img src='https://www.jb51.net/images/6.gif'> <input type='radio' value='[7]'><img src='https://www.jb51.net/images/7.gif'> <input type='radio' value='8'><img src='https://www.jb51.net/images/8.gif'> <input type='radio' value='9'><img src='https://www.jb51.net/images/9.gif'></div></td></tr>";
echo "<tr bgcolor='#eeeeee'><td colspan='2'></td></tr>";
echo "</table></td></tr></table>";
echo "<div><INPUT TYPE='HIDDEN' VALUE='add'><INPUT TYPE='SUBMIT' VALUE='提 交!'><INPUT class=bott TYPE='RESET' VALUE='重 填'></form></div>";
}
function dlmes($mess)
{
echo "<table cellspacing='0' cellpadding='0' bgcolor='#000000'>";
echo "<tr><td>";
echo "<table cellspacing='1' cellpadding='1' bgcolor='#eeeeee'><form method='post'>";
echo "<tr bgcolor='#009999'><td><div><font color='#FFFFFF'>".$mess."</font></div></td></tr>";
echo "<tr><td><div>用户名:<input type='text'></div></td></tr>";
echo "<tr><td><div>密 码:<input type='password'></div></td></tr>";
echo "<tr><td><div><input type='submit' value='确定'></div></td></tr>";
echo "<tr><td><input type='hidden' value='dl'></td></tr>";
echo "<tr><td><div><a href='https://www.jb51.net/useinfo.php?action=pass'>[忘记密码]</a> <a href='https://www.jb51.net/reguse.php?action=xy'>[我要注册]</a></div></td></tr>";
echo "<tr bgcolor='#009999'><td></td></tr>";
echo "</form></table></td></tr></table>";
}
?>