<?php
//echo(rand(1000,90000));
//echo(rand(15000,999999));
require 'config.inc.php';
require 'db.php';
function GetRandNum(){ return (rand(15000,999999)); }
$idtemp=GetRandNum(); while(!isset($repeat)){ $query=mysql_query(“select count(*) from user where jid=’".$idtemp."’”); if(mysql_result($query, 0)>0) $idtemp–; else $repeat="uGain"; } $result=array('result’=>$idtemp,’server’=>JIDHOSTNAME); $resultString=json_encode($result); echo $resultString; ?>