Просмотр файла banners.ru/www/forum/finduser.php

Размер файла: 3.75Kb
<?
header("Content-Type: text/vnd.wap.wml; charset=utf-8");






require "consts.php";
$conn=mysql_connect(my_host, my_user, my_password);
mysql_select_db(my_db, $conn);
$truba=$HTTP_USER_AGENT;
$telefon=$_SERVER['HTTP_X_NOKIA_MSISDN'];
$oper=getenv('REMOTE_ADDR');



if(isset($HTTP_GET_VARS['UIN']))
{
$name1=$HTTP_GET_VARS['UIN'];
}
else
{
$name1="Guest";
}
$UINmd5=$name1;




if(isset($HTTP_GET_VARS['pass']))

{

$pass=$HTTP_GET_VARS['pass'];

}

else

{

$pass="Guest";

}
if(isset($HTTP_GET_VARS['next_row']))
{
$next_row=$HTTP_GET_VARS['next_row'];
}
else
{
$next_row=0;
}






$sql="select pass from users where name='$name1'";
$res=mysql_query($sql);
$row=mysql_fetch_object($res);
$tempp=$row->nick;
if ($pass!=$row->pass)
{
$name1="Guest";
}

$dpoint=".";
$dpoint2=":";


$time2 =date(d);
$time2 .=$dpoint;
$time2 .=date(m);
$time2 .=$dpoint;
$time2 .=date(y);
$time2 .= " - ";
$time2 .=date(H);
$time2.=$dpoint2;
$time2.=date(i);
$time2.=$dpoint2;
$time2 .=date(s);

$sql="update users set last='$time2' where id='$UIN'";
mysql_query($sql);

$sql="update users set truba='$truba' where id='$UIN'";
mysql_query($sql);
if ($num_tel!="")
{
$sql="update users set telefon='$telefon' where id='$UIN'";
mysql_query($sql);
}
$sql="update users set oper='$oper' where id='$UIN'";
mysql_query($sql);





$sqlnew="select * from users where sex='$sex' and age>0";



if ($data5!="")
{
$sqlnew.=" and otkuda='$data5'";
}
if (($data71!="") and ($data72!=""))
{
$sqlnew.=" and (age>='$data71' and age<='$data72')";
}
if ($data8!="")
{
$sqlnew.=" and email='$data8'";
}
if (($data151!="") and ($data152!=""))
{
$sqlnew.=" and (rost>='$data151' and rost<='$data152')";
}
if ($data16!="")
{
$sqlnew.=" and ves='$data16'";
}
if ($iye_color!="")
{
$sqlnew.=" and iye_color='$iye_color'";
}
if ($data10!="")
{
$sqlnew.=" and mops='$data10'";
}
if ($hair_color!="")
{
$sqlnew.=" and hair_color='$hair_color'";
}
if ($country!="")
{
$sqlnew.=" and country='$country'";
}
if ($city!="")
{
$sqlnew.=" and city='$city'";
}

$n=0;

$res=mysql_query($sqlnew);
while ($row=mysql_fetch_object($res))
{
$n=$n+1;
}



$sqlnew.=" order by last_update desc Limit $next_row, 10";



$a=0;





function search($sql, $UIN, $pass, $id, $sex)
{
$res=mysql_query($sql);
while ($row=mysql_fetch_object($res))
{
$nick=translate($row->nick);
?>

<b><a href="userinfo.php?UIN=<?=$UIN?>&amp;pass=<?=$pass?>&amp;id=<?=$row->id?>&amp;sex=<?=$sex?>"><?=$nick?>(<?=$row->age?>)</a></b><br/>
                
<?



}


return;
}





echo '<?xml version="1.0" encoding="utf-8"?>';
echo '<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.2//EN"
   "http://www.wapforum.org/DTD/wml1.2.dtd">';
echo '<wml>';
?>
<card id="FIND" title="&#x041D;&#x0430;&#x0439;&#x0434;&#x0435;&#x043D;&#x043E; (<?=$n?>)">
<p>

<?
search($sqlnew, $UIN, $pass, $id, $sex);
$next_row=$next_row+10;
if ($n==0)

{
echo '<br/>';
echo 'User not found';
}
else
{
?>

<anchor title="&#x0414;&#x0430;&#x043B;&#x044C;&#x0448;&#x0435;">&#x0414;&#x0430;&#x043B;&#x044C;&#x0448;&#x0435;
<go method="post" href="finduser.php?UIN=<?=$UIN?>&amp;pass=<?=$pass?>&amp;next_row=<?=$next_row?>&amp;sex=<?=$sex?>">

<postfield name="data5" value="<?=$data5?>"/>
<postfield name="data71" value="<?=$data71?>"/>
<postfield name="data72" value="<?=$data72?>"/>
<postfield name="data8" value="<?=$data8?>"/>
<postfield name="data10" value="<?=$data10?>"/>
<postfield name="data151" value="<?=$data151?>"/>
<postfield name="data152" value="<?=$data152?>"/>
<postfield name="data16" value="<?=$data16?>"/>
<postfield name="data17" value="<?=$data17?>"/>
<postfield name="data18" value="<?=$data18?>"/>
<postfield name="nick" value="$(name)"/>
</go>
</anchor>
<br/>
<a href="index.php?UIN=<?=$UIN?>&amp;pass=<?=$pass?>">&#x0413;&#x043B;&#x0430;&#x0432;&#x043D;&#x0430;&#x044F;</a><br/>
<?
}

end_page(1);
?>



 </p>
 </card>
 </wml>