www.gusucode.com > 仿51.com的php源码 1.1 > RandomUser/RandomUser.php

    <?php include("../include/dbclass.php"); 
$dbc=new DbConn();
$user=$_GET["user"];
if($user==null)
{
$sql="select User_Account from userdata where face<>'images/nophoto.gif' order by rand() desc limit 0,1";
$rs=$dbc->getRs($sql);
$str=$rs["User_Account"];
}
else
{
$sql="select User_Account from userdata where User_Account<>'$user' and  face<>'images/nophoto.gif' order by rand() desc limit 0,1";
$rs=$dbc->getRs($sql);
$str=$rs["User_Account"];
}
//echo $str;
header("Location:../home.php?user=$str");

?>