我的论坛源代码(十)
2001-02-14 16:32:12 来源:WEB开发网核心提示:reguse.inc.php处理注册用户时的信息 <? function regok($mess,$reginfo) //记录成功后输出用户信息 { echo "<table width='70%' border='0' cellspacing='0'
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'><div align='center'><font color='ffffff'>".$mess."</font></div></td></tr>";
echo "<tr ><td width='15%' ><div align='left'>ID号:</div></td><td width='35%'><div align='center'><font color='#FF0000'>".$reginfo[13]."</font></div></td>";
echo "<td width='15%'><div align='left'>用户:</div></td><td width='35%' ><div align='center'><font color='#FF0000'>".$reginfo[0]."</div></td></tr>";
echo "<tr ><td width='15%'><div align='left'>密码:</div></td><td width='35%'><div align='center'><font color='#FF0000'>".$reginfo[1]."</font></div></td>";
echo "<td width='15%'><div align='left'>主页:</div></td><td width='35%' ><div align='center'><font color='#FF0000'>".$reginfo[9]."</div></td></tr>";
echo "<tr ><td width='15%'><div align='left'>邮箱:</div></td><td width='35%'><div align='center'><font color='#FF0000'>".$reginfo[8]."</font></div></td>";
echo "<td width='15%'><div align='left'>oicq:</div></td><td width='35%'><div align='center'><font color='#FF0000'>".$reginfo[3]."</div></td></tr>";
echo "<tr ><td width='15%'><div align='left'>昵称:</div></td><td width='35%'><div align='center'><font color='#FF0000'>".$reginfo[2]."</font></div></td>";
echo "<td width='15%'><div align='left'>等级:</div></td><td width='35%'><div align='center'><font color='#FF0000'>".$reginfo[11]."</div></td></tr>";
echo "<tr ><td width='15%'><div align='left'>性别:</div></td><td width='35%'><div align='center'><font color='#FF0000'>".$reginfo[4]."</font></div></td>";
echo "<td width='15%'><div align='left'>年龄:</div></td><td width='35%'><div align='center'><font color='#FF0000'>".$reginfo[5]."</div></td></tr>";
echo "<tr ><td width='15%'><div align='left'>职业:</div></td><td width='35%'><div align='center'><font color='#FF0000'>".$reginfo[6]."</font></div></td>";
echo "<td width='15%'><div align='left'>来自:</div></td><td width='35%' ><div align='center'><font color='#FF0000'>".$reginfo[7]."</div></td></tr>";
echo "<tr ><td width='15%'><div align='left'>信息保密:</div></td><td width='35%'><div align='center'><font color='#FF0000'>".$reginfo[12]."</font></div></td>";
echo "<td width='15%'><div align='left'>签名:</div></td><td width='35%' ><div align='center'><font color='#FF0000'>".$reginfo[10]."</div></td></tr>";
echo "<tr ><td width='15%'><div align='left'>邮件通知:</div></td><td width='35%'><div align='center'><font color='#FF0000'>".$reginfo[18]."</font></div></td>";
echo "<td width='15%'><div align='left'>注册时间:</div></td><td width='35%' ><div align='center'><font color='#FF0000'>".$reginfo[15]."</div></td></tr>";
echo "<tr ><td width='15%'><div align='left'>登录时间:</div></td><td width='35%'><div align='center'><font color='#FF0000'>".$reginfo[16]."</font></div></td>";
echo "<td width='15%'><div align='left'>头像:</div></td><td width='35%' ><div align='center'><img src='http://www.cncms.com/images/".$reginfo[14].".gif'></div></td></tr>";
$reginfo=$reginfo[0];
echo "<tr bgcolor='#006699'><td colspan='4'><div align='center'><a href='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 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'><div align='center'>狐网论坛用户注册---<font color='00ff00'>".$mess."</font></div></font></td></tr>";
echo "<tr bgcolor='#eeeeee'><td width='40%'><div align='left'> 用 户 名:<font color='#FF0000'>八位,第一位必须是字母</FONT></div></td><td width='52%'><input ></td></tr>";
echo "</form></table></td></tr></table>";
}
?>
<?
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'><div align='center'><font color='ffffff'>".$mess."</font></div></td></tr>";
echo "<tr ><td width='15%' ><div align='left'>ID号:</div></td><td width='35%'><div align='center'><font color='#FF0000'>".$reginfo[13]."</font></div></td>";
echo "<td width='15%'><div align='left'>用户:</div></td><td width='35%' ><div align='center'><font color='#FF0000'>".$reginfo[0]."</div></td></tr>";
echo "<tr ><td width='15%'><div align='left'>密码:</div></td><td width='35%'><div align='center'><font color='#FF0000'>".$reginfo[1]."</font></div></td>";
echo "<td width='15%'><div align='left'>主页:</div></td><td width='35%' ><div align='center'><font color='#FF0000'>".$reginfo[9]."</div></td></tr>";
echo "<tr ><td width='15%'><div align='left'>邮箱:</div></td><td width='35%'><div align='center'><font color='#FF0000'>".$reginfo[8]."</font></div></td>";
echo "<td width='15%'><div align='left'>oicq:</div></td><td width='35%'><div align='center'><font color='#FF0000'>".$reginfo[3]."</div></td></tr>";
echo "<tr ><td width='15%'><div align='left'>昵称:</div></td><td width='35%'><div align='center'><font color='#FF0000'>".$reginfo[2]."</font></div></td>";
echo "<td width='15%'><div align='left'>等级:</div></td><td width='35%'><div align='center'><font color='#FF0000'>".$reginfo[11]."</div></td></tr>";
echo "<tr ><td width='15%'><div align='left'>性别:</div></td><td width='35%'><div align='center'><font color='#FF0000'>".$reginfo[4]."</font></div></td>";
echo "<td width='15%'><div align='left'>年龄:</div></td><td width='35%'><div align='center'><font color='#FF0000'>".$reginfo[5]."</div></td></tr>";
echo "<tr ><td width='15%'><div align='left'>职业:</div></td><td width='35%'><div align='center'><font color='#FF0000'>".$reginfo[6]."</font></div></td>";
echo "<td width='15%'><div align='left'>来自:</div></td><td width='35%' ><div align='center'><font color='#FF0000'>".$reginfo[7]."</div></td></tr>";
echo "<tr ><td width='15%'><div align='left'>信息保密:</div></td><td width='35%'><div align='center'><font color='#FF0000'>".$reginfo[12]."</font></div></td>";
echo "<td width='15%'><div align='left'>签名:</div></td><td width='35%' ><div align='center'><font color='#FF0000'>".$reginfo[10]."</div></td></tr>";
echo "<tr ><td width='15%'><div align='left'>邮件通知:</div></td><td width='35%'><div align='center'><font color='#FF0000'>".$reginfo[18]."</font></div></td>";
echo "<td width='15%'><div align='left'>注册时间:</div></td><td width='35%' ><div align='center'><font color='#FF0000'>".$reginfo[15]."</div></td></tr>";
echo "<tr ><td width='15%'><div align='left'>登录时间:</div></td><td width='35%'><div align='center'><font color='#FF0000'>".$reginfo[16]."</font></div></td>";
echo "<td width='15%'><div align='left'>头像:</div></td><td width='35%' ><div align='center'><img src='http://www.cncms.com/images/".$reginfo[14].".gif'></div></td></tr>";
$reginfo=$reginfo[0];
echo "<tr bgcolor='#006699'><td colspan='4'><div align='center'><a href='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 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'><div align='center'>狐网论坛用户注册---<font color='00ff00'>".$mess."</font></div></font></td></tr>";
echo "<tr bgcolor='#eeeeee'><td width='40%'><div align='left'> 用 户 名:<font color='#FF0000'>八位,第一位必须是字母</FONT></div></td><td width='52%'><input ></td></tr>";
echo "</form></table></td></tr></table>";
}
?>
更多精彩
赞助商链接