www.gusucode.com > 仿51.com的php源码 1.1 > User/UserCheck.php
<?php header ("Cache-Control: no-cache, must-revalidate"); header ("Pragma: no-cache"); ?><?php include("../include/dbclass.php"); ?> <?php $Users=$_GET["user"]; $db=new DbConn(); $sql="select User_Account from userdata where User_Account='$Users'"; $query_id=$db->query($sql); $num=$db->num_rows($query_id); if ($num==0) { echo("false"); } else { echo("true|"); $array = array(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,0,1,2,3,4,5,6,7,8,9); $key = array_rand($array,36); $User=strtolower($Users); $j=0; while ($j<=2) { $str =$User; for($i=$j;$i<36;$i++) { $str .= $array[$key[$i]]; $sql="select User_Account from userdata where User_Account='$str'"; $query_id=$db->query($sql); $num=$db->num_rows($query_id); if ($num==0) { echo $str; if ($j !=2) { echo ","; } break; } else { continue; } } $j++; } //echo $str; } ?>