reguse.php用户注册与登录页面
if ($action==dl&&$uname)
{
$uinfo=$uname."|".$upass;
setcookie("FlyFoxNet",$uinfo,time()+3600);
}
?>
用户注册 include "linkfox.inc.php";
include "info.inc.php";
include "reguse.inc.php";
function dlokey($user) //登录成功显示
{
echo "";
echo "
";
echo ""; echo "欢迎你!".$user[3]." | "; echo "你上次访问本站的时间是:".$user[2]." | "; echo "你现在可以 <发布新帖> <查看主题> <修改信息> | "; echo "
|
";
}
?>
if ($action==xy)
{
echo "
"; echo ""; echo "狐网论坛 规定 | "; echo ""; echo "你在这个论坛注册是完全免费的! 我们希望您遵守以下的论坛规定. 请仔细阅读下列条款. 如果您同意请按 '我同意' 按钮. 如果您不同意,"; echo "请按 '不同意' 按钮退出. "; echo " 1. 遵守中华人民共和国的各项有关法律法规. "; echo " 2. 不得在发布任何色情非法, 以及危害国家安全的言论. "; echo " 3. 严禁链接有关政治, 色情, 宗教, 迷信等违法信息. "; echo " 4. 承担一切因您的行为而直接或间接导致的民事或刑事法律责任; "; echo " 5. 互相尊重, 遵守互联网络道德; 严禁互相恶意攻击, 漫骂; "; echo " 6. 管理员及版主有权保留或删除论坛中的任意内容; "; echo " 7. 本站网管拥有一切管理权力. "; echo " 8. 在此论坛发表的原创文章,版权规作者与狐网共有。 "; echo " | "; echo " |
";
echo "";
echo "";
}
else if ($action==reg)
{
usemess("请在下表填写注册信息",'必填','必填','必填','必填','必填','必填','必填');
}
if ($action==add)
{
if ($useni) //如果有信息
{
for ($i=0;$i<10;$i++)
{
if ($bq[$i]) $usebq=$bq[$i];
}
$reginfo=reg($usename,$usepass,$usemail,$useweb,$useni,$useoicq,$usesex,$useage,$usezy,$useaddr,$useinf,$usety,$usebq,$useqm);
switch ($reginfo)
{
case ($reginfo==1):
usemess("错误!用户名超长",$usename,$usemail,$useweb,$useni,$useoicq,$useaddr,$useqm);
break;
case ($reginfo==2):
usemess("错误!密码超长",$usename,$usemail,$useweb,$useni,$useoicq,$useaddr,$useqm);
break;
case ($reginfo==3):
usemess("错误!oicq号非法",$usename,$usemail,$useweb,$useni,$useoicq,$useaddr,$useqm);
break;
case ($reginfo==4):
usemess("错误!用户密码含有非法字符",$usename,$usemail,$useweb,$useni,$useoicq,$useaddr,$useqm);
break;
case ($reginfo==5):
usemess("错误!用户名含有非法字符",$usename,$usemail,$useweb,$useni,$useoicq,$useaddr,$useqm);
break;
case ($reginfo==6):
usemess("错误!非法OICQ号",$usename,$usemail,$useweb,$useni,$useoicq,$useaddr,$useqm);
break;
case ($reginfo==7):
usemess("错误!非法EMAIL地址",$usename,$usemail,$useweb,$useni,$useoicq,$useaddr,$useqm);
break;
case ($reginfo==8):
usemess("非常报歉!这个用户已经存在,请重新选择",$usename,$usemail,$useweb,$useni,$useoicq,$useaddr,$useqm);
break;
case ($reginfo==9):
usemess("未知错误!",$usename,$usemail,$useweb,$useni,$useoicq,$useaddr,$useqm);
break;
case ($reginfo==10):
usemess("写入数据库错误,请与
黑暗居士联系",$usename,$usemail,$useweb,$useni,$useoicq,$useaddr,$useqm);
break;
default:
$reginfo=update($reginfo);
regok("注册成功,以下是你的个人信息",$reginfo);
break;
}
}
else usemess("请填写好你的信息",'必填','必填','必填','必填','必填','必填','必填');
}
if ($action==dl) //登录函数
{
if ($uname)
{
$query="select usepass,usename,enddate,useni from useinfo where usename='".$uname."'"; //检查是否存在用户
$req=@mysql_query($query);
if ($req)
{
$user=@mysql_fetch_array($req);
if ($user[0]==$upass) //检查口令是否正确
{
$time=date(Y年n月j日G时i分);
$query="update useinfo set enddate='$time' where usename='".$uname."'";
$req=@mysql_query($query);
if ($req) dlokey($user);
else dlmes("数据登录错误!");
}
else dlmes("用户密码不正确,请校验!");
}
else dlmes("不能找到用户信息,请确认!如果还未注册,请点击这里");
}
else dlmes("用户登录");
}
?>