";
}
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("用户登录");
}
?>