最新赞助活动温馨提示:自愿赞助服务器费用,学生和没有工作的整站资源免费下载!
头像

我的论坛源代码(十)_php基础

来源:http://erdangjiade.com/topic/123630.html 你好,世界。 2017-10-04 21:03浏览(21)

reguse.inc.php处理注册用户时的信息

<?

function regok($mess,$reginfo) //记录成功后输出用户信息
{
echo "<table width='70%' border='0' cellspacing='0' cellpadding='0' bgcolor='#000000' align='center'>";
echo "<tr><td><table width='100%' border='0' cellspacing='1' cellpadding='1' align='center' bgcolor='#eeeeee'><tr bgcolor='#006699'><td colspan='4'><p align='center'><font color='ffffff'>".$mess."</font></p></td></tr>";
echo "<tr ><td width='15%' ><p align='left'>ID号:</p></td><td width='35%'><p align='center'><font color='#FF0000'>".$reginfo[13]."</font></p></td>";
echo "<td width='15%'><p align='left'>用户:</p></td><td width='35%' ><p align='center'><font color='#FF0000'>".$reginfo[0]."</p></td></tr>";
echo "<tr ><td width='15%'><p align='left'>密码:</p></td><td width='35%'><p align='center'><font color='#FF0000'>".$reginfo[1]."</font></p></td>";
echo "<td width='15%'><p align='left'>主页:</p></td><td width='35%' ><p align='center'><font color='#FF0000'>".$reginfo[9]."</p></td></tr>";
echo "<tr ><td width='15%'><p align='left'>邮箱:</p></td><td width='35%'><p align='center'><font color='#FF0000'>".$reginfo[8]."</font></p></td>";
echo "<td width='15%'><p align='left'>oicq:</p></td><td width='35%'><p align='center'><font color='#FF0000'>".$reginfo[3]."</p></td></tr>";
echo "<tr ><td width='15%'><p align='left'>昵称:</p></td><td width='35%'><p align='center'><font color='#FF0000'>".$reginfo[2]."</font></p></td>";
echo "<td width='15%'><p align='left'>等级:</p></td><td width='35%'><p align='center'><font color='#FF0000'>".$reginfo[11]."</p></td></tr>";
echo "<tr ><td width='15%'><p align='left'>性别:</p></td><td width='35%'><p align='center'><font color='#FF0000'>".$reginfo[4]."</font></p></td>";
echo "<td width='15%'><p align='left'>年龄:</p></td><td width='35%'><p align='center'><font color='#FF0000'>".$reginfo[5]."</p></td></tr>";
echo "<tr ><td width='15%'><p align='left'>职业:</p></td><td width='35%'><p align='center'><font color='#FF0000'>".$reginfo[6]."</font></p></td>";
echo "<td width='15%'><p align='left'>来自:</p></td><td width='35%' ><p align='center'><font color='#FF0000'>".$reginfo[7]."</p></td></tr>";
echo "<tr ><td width='15%'><p align='left'>信息保密:</p></td><td width='35%'><p align='center'><font color='#FF0000'>".$reginfo[12]."</font></p></td>";
echo "<td width='15%'><p align='left'>签名:</p></td><td width='35%' ><p align='center'><font color='#FF0000'>".$reginfo[10]."</p></td></tr>";
echo "<tr ><td width='15%'><p align='left'>邮件通知:</p></td><td width='35%'><p align='center'><font color='#FF0000'>".$reginfo[18]."</font></p></td>";
echo "<td width='15%'><p align='left'>注册时间:</p></td><td width='35%' ><p align='center'><font color='#FF0000'>".$reginfo[15]."</p></td></tr>";
echo "<tr ><td width='15%'><p align='left'>登录时间:</p></td><td width='35%'><p align='center'><font color='#FF0000'>".$reginfo[16]."</font></p></td>";
echo "<td width='15%'><p align='left'>头像:</p></td><td width='35%' ><p align='center'><img src='images/".$reginfo[14].".gif'></p></td></tr>";
$reginfo=$reginfo[0];
echo "<tr bgcolor='#006699'><td colspan='4'><p align='center'><a href='reguse.php?action=dl&use=".$reginfo."'>用户登录</a></p></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 width='90%' border='0' cellspacing='0' cellpadding='0' bgcolor='#000000' align='center'>";
echo "<tr><td><table width='100%' border='0' cellspacing='1' cellpadding='1' align='center'>";
echo "<tr bgcolor='#006699'><td colspan='2'><font color='ffffff'><p align='center'>狐网论坛用户注册---<font color='00ff00'>".$mess."</font></p></font></td></tr>";
echo "<tr bgcolor='#eeeeee'><td width='40%'><p align='left'> 用 户 名:<font color='#FF0000'>八位,第一位必须是字母</FONT></p></td><td width='52%'><input onFocus='this.select()' style='BACKGROUND-COLOR: #ffffff; BORDER-BOTTOM: #000000 1px dashed; BORDER-LEFT: #000000 1px dashed; BORDER-RIGHT: #000000 1px dashed; BORDER-TOP: #000000 1px dashed;' type='text' name='usename' size='30' maxlength='8' value='".$usename."'></td></tr>";
echo "<tr bgcolor='#eeeeee'><td width='40%'><p align='left'>密  码:<font color='#FF0000'>八位,数字和字母组合.</font></p></td><td width='52%'><input style='BACKGROUND-COLOR: #ffffff; BORDER-BOTTOM: #000000 1px dashed; BORDER-LEFT: #000000 1px dashed; BORDER-RIGHT: #000000 1px dashed; BORDER-TOP: #000000 1px dashed;' type='password' name='usepass' size='30' maxlength='8'></td></tr>";
echo "<tr bgcolor='#eeeeee'><td width='40%'><p align='left'>电子信箱:<font color='#FF0000'>请填写真实的邮箱地址。</font></p></td><td width='52%'><input onFocus='this.select()' style='BACKGROUND-COLOR: #ffffff; BORDER-BOTTOM: #000000 1px dashed; BORDER-LEFT: #000000 1px dashed; BORDER-RIGHT: #000000 1px dashed; BORDER-TOP: #000000 1px dashed;' type='text' name='usemail' size='50' maxlength='50' value='".$usemail."'></td></tr>";
echo "<tr bgcolor='#eeeeee'><td width='40%'><p align='left'>个人主页:</p></td><td width='52%'><p align='left'><input onFocus='this.select()' style='BACKGROUND-COLOR: #ffffff; BORDER-BOTTOM: #000000 1px dashed; BORDER-LEFT: #000000 1px dashed; BORDER-RIGHT: #000000 1px dashed; BORDER-TOP: #000000 1px dashed;' type='text' name='useweb' size='50' maxlength='50' value='".$useweb."'></p></td></tr>";
echo "<tr bgcolor='#006699'><td colspan='2'><p align='center'><font color='#FFFFFF'>个人信息设定</font></p></td></tr>";
echo "<tr bgcolor='#eeeeee'><td width='40%'><p align='left'>你的昵称:</p></td><td width='52%'><p align='left'><input onFocus='this.select()' style='BACKGROUND-COLOR: #ffffff; BORDER-BOTTOM: #000000 1px dashed; BORDER-LEFT: #000000 1px dashed; BORDER-RIGHT: #000000 1px dashed; BORDER-TOP: #000000 1px dashed;' type='text' name='useni' size='30' maxlength='15' value='".$useni."'></p></td></tr>";
echo "<tr bgcolor='#eeeeee'><td width='40%'><p align='left'>OICQ:</p></td><td width='52%'><p align='left'><input onFocus='this.select()' style='BACKGROUND-COLOR: #ffffff; BORDER-BOTTOM: #000000 1px dashed; BORDER-LEFT: #000000 1px dashed; BORDER-RIGHT: #000000 1px dashed; BORDER-TOP: #000000 1px dashed;' type='text' name='useoicq' size='20' maxlength='20' value='".$useoicq."'></p></td></tr>";
echo "<tr bgcolor='#eeeeee'><td width='40%'><p align='left'>性  别:</p></td><td width='52%'><p align='left'><select onFocus='this.select()' style='BACKGROUND-COLOR: #ffffff; BORDER-BOTTOM: #000000 1px dashed; BORDER-LEFT: #000000 1px dashed; BORDER-RIGHT: #000000 1px dashed; BORDER-TOP: #000000 1px dashed;' name='usesex'><option value='1' selected>我是男生</option><option value='0'>我是女生</option></select></p></td></tr>";
echo "<tr bgcolor='#eeeeee'><td width='40%'><p align='left'>年  龄:</p></td><td width='52%'><p align='left'><select onFocus='this.select()' style='BACKGROUND-COLOR: #ffffff; BORDER-BOTTOM: #000000 1px dashed; BORDER-LEFT: #000000 1px dashed; BORDER-RIGHT: #000000 1px dashed; BORDER-TOP: #000000 1px dashed;' name='useage'><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></p></td></tr>";
echo "<tr bgcolor='#eeeeee'><td width='40%'><p align='left'>职  业:</p></td><td width='52%'><p align='left'><select onFocus='this.select()' style='BACKGROUND-COLOR: #ffffff; BORDER-BOTTOM: #000000 1px dashed; BORDER-LEFT: #000000 1px dashed; BORDER-RIGHT: #000000 1px dashed; BORDER-TOP: #000000 1px dashed;' name='usezy'><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></p></td></tr>";
echo "<tr bgcolor='#eeeeee'><td width='40%'><p align='left'>来自何方:</p></td><td width='52%'><p align='left'><input onFocus='this.select()' style='BACKGROUND-COLOR: #ffffff; BORDER-BOTTOM: #000000 1px dashed; BORDER-LEFT: #000000 1px dashed; BORDER-RIGHT: #000000 1px dashed; BORDER-TOP: #000000 1px dashed;' type='text' name='useaddr' size='50' maxlength='50' value='".$useaddr."'></p></td></tr>";
echo "<tr bgcolor='#006699'><td colspan='2'><p align='left'></p><p align='center'><font color='#FFFFFF'>参数设定</font></p></td></tr>";
echo "<tr bgcolor='#eeeeee'><td width='40%'><p align='left'>是否充许他人查看你的信息:</p></td><td width='52%'><p align='left'><input type='radio' name='useinf' value='2'>否  <input type='radio' name='useinf2' value='1' checked>是</p></td></tr>";
echo "<tr bgcolor='#eeeeee'><td width='40%' valign='top'><p align='left'>个人签名档:</p></td><td width='52%'><p align='left'><textarea onFocus='this.select()' style='BACKGROUND-COLOR: #ffffff; BORDER-BOTTOM: #000000 1px dashed; BORDER-LEFT: #000000 1px dashed; BORDER-RIGHT: #000000 1px dashed; BORDER-TOP: #000000 1px dashed;' name='useqm' cols='40' wrap='VIRTUAL' rows='5'>".$useqm."</textarea></p></td></tr>";
echo "<tr bgcolor='#eeeeee'><td width='40%'><p align='left'>是否允许版主或管理员给你发邮件通知:</p></td><td width='52%'><p align='left'><input type='radio' name='usety' value='2'>否  <input type='radio' name='usee2' value='1' checked>是</p></td></tr>";
echo "<tr bgcolor='#006699'><td colspan='2'><p align='center'><font color='#FFFFFF'>头像设定</font></p></td></tr>";
echo "<tr bgcolor='#eeeeee'><td colspan='2'><p align='center'><input type='radio' name='bq[0]' value='a'><img src='images/a.gif' width='15' height='15' checked>  <input type='radio' name='bq[1]' value='1'><img src='images/1.gif' width='15' height='15'>  <input type='radio' name='bq[2]' value='2'><img src='images/2.gif' width='15' height='15'>  <input type='radio' name='bq[3]' value='3'><img src='images/3.gif' width='15' height='15'>  <input type='radio' name='ba[4]' value='4'><img src='images/4.gif' width='15' height='15'>  ";
echo "<input type='radio' name='bq[5]' value='5'><img src='images/5.gif' width='15' height='15'>  <input type='radio' name='bq[6]' value='6'><img src='images/6.gif' width='15' height='15'>  <input type='radio' name='ba7' value='[7]'><img src='images/7.gif' width='15' height='15'>  <input type='radio' name='ba[8]' value='8'><img src='images/8.gif' width='15' height='15'>  <input type='radio' name='ba[9]' value='9'><img src='images/9.gif' width='15' height='15'></p></td></tr>";
echo "<tr bgcolor='#eeeeee'><td colspan='2'></td></tr>";
echo "</table></td></tr></table>";
echo "<p align='center'><INPUT TYPE='HIDDEN' NAME='action' VALUE='add'><INPUT class='bott' TYPE='SUBMIT' name='submit' VALUE='提 交!'><INPUT class=bott TYPE='RESET' NAME='Reset' VALUE='重 填'></form></p>";
}
function dlmes($mess)
{
echo "<table width='50%' border='0' cellspacing='0' cellpadding='0' bgcolor='#000000' align='center'>";
echo "<tr><td>";
echo "<table width='100%' border='0' cellspacing='1' cellpadding='1' bgcolor='#eeeeee'><form method='post'>";
echo "<tr bgcolor='#009999'><td><p align='center'><font color='#FFFFFF'>".$mess."</font></p></td></tr>";
echo "<tr><td><p align='center'>用户名:<input type='text' name='uname'></p></td></tr>";
echo "<tr><td><p align='center'>密 码:<input type='password' name='upass'></p></td></tr>";
echo "<tr><td><p align='center'><input type='submit' name='Submit' value='确定'></p></td></tr>";
echo "<tr><td><input type='hidden' name='action' value='dl'></td></tr>";
echo "<tr><td><p align='center'><a href='useinfo.php?action=pass'>[忘记密码]</a>     <a href='reguse.php?action=xy'>[我要注册]</a></p></td></tr>";
echo "<tr bgcolor='#009999'><td height='20'></td></tr>";
echo "</form></table></td></tr></table>";
}
?>
评论0
头像

友情提示:垃圾评论一律封号 加我微信:826096331拉你进VIP群学习群

1 2