当前位置:Gxlcms > PHP教程 > 我的论坛源代码(十)_php基础

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

时间:2021-07-01 10:21:17 帮助过:21人阅读

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


function regok($mess,$reginfo) //记录成功后输出用户信息
{
echo "";
echo "
";
echo "";
echo "";
echo "";
echo "";
echo "";
echo "";
echo "";
echo "";
echo "";
echo "";
echo "";
echo "";
echo "";
echo "";
echo "";
echo "";
echo "";
echo "";
$reginfo=$reginfo[0];
echo "";
echo "
".$mess."
ID号:".$reginfo[13]."用户:".$reginfo[0]."
密码:".$reginfo[1]."主页:".$reginfo[9]."
邮箱:".$reginfo[8]."oicq:".$reginfo[3]."
昵称:".$reginfo[2]."等级:".$reginfo[11]."
性别:".$reginfo[4]."年龄:".$reginfo[5]."
职业:".$reginfo[6]."来自:".$reginfo[7]."
信息保密:".$reginfo[12]."签名:".$reginfo[10]."
邮件通知:".$reginfo[18]."注册时间:".$reginfo[15]."
登录时间:".$reginfo[16]."头像:
用户登录
";


}



//检查信息并写入记录
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 "";
}
function dlmes($mess)
{
echo "";
echo "
";
echo "
";
}
?>

人气教程排行