<?
Error_Reporting(E_ALL & ~E_NOTICE); /////////////// игнорируем ошибки
header ("Content-type:text/vnd.wap.wml; charset=utf-8");
$rand=rand(10000,1000000);
require("conf.inc.php");
global $REMOTE_ADDR;
global $HTTP_USER_AGENT;
$id=@mysql_escape_string($id);
$pass=@mysql_escape_string($pass);
$login=@mysql_escape_string($login);
$link=mysql_pconnect ($DB_HOST, $DB_USER, $DB_PASS);
mysql_select_db($DB_NAME);
if(empty($id)) {
$find_user=mysql_query("Select * from users where cid='".$cid."' AND login='".$login."' and pass='".$pass."'") or die("Querry error");
} else {
$find_user=mysql_query("Select * from users where cid='".$cid."' AND id='".$id."' and pass='".$pass."'") or die("Querry error");
}
if(mysql_affected_rows()==0)
{
echo <<<END
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<card id="search" title="РџРѕРСвЂВВВРЎРѓР С”">
<p align="center">
Логин или пароль неверны, проверьте ваш ввод.
</p>
</card>
</wml>
END;
return 0;
}
else
{
$row=mysql_fetch_array($find_user);
$login=$row['login'];
$id=$row['id'];
$admin=$row['admin'];
if (($row["browser"]!==$HTTP_USER_AGENT) or ($row["ip"]!==$REMOTE_ADDR))
{
mysql_query("update users set browser='$HTTP_USER_AGENT', ip='$REMOTE_ADDR' where cid='".$cid."' AND id='$id';");
}
//Проверка, не забанен ли ip+browser:
mysql_query ("Select * from bannedib WHERE cid='".$cid."' AND (ip = '".$REMOTE_ADDR."')and(browser = '".$HTTP_USER_AGENT."')");
if(mysql_affected_rows()!=0)
{
echo <<<END
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<card id="error" title="Забанен">
<p align="center">
Вы забанены по связке ip+browser!
</p>
</card>
</wml>
END;
exit;
}
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.2//EN\" \"http://www.wapforum.org/DTD/wml12.dtd\">\n";
echo "<wml>\n";
echo "<card title=\"Search\">\n";
echo "<p align=\"left\">\n";
$id=@mysql_escape_string($id);
$pass=@mysql_escape_string($pass);
$who=@mysql_escape_string($who);
$action=@mysql_escape_string($action);
if(empty($action)) {
print "Кого найти:<br/><input name=\"who\"/><br/>
<anchor>искать<go href=\"search.php?id=$id&pass=$pass&cid=$cid\" method=\"post\">
<postfield name=\"action\" value=\"search\"/>
<postfield name=\"who\" value=\"$(who)\"/>
</go></anchor>";
} else {
$q_s=@mysql_query("select * from users where cid='".$cid."' AND login='".$who."';");
$q_l=@mysql_query("select * from users where cid='".$cid."' AND (login='".$login."' or where id='".$id."');");
if (@MySQL_Num_rows($q_s)==0) {print "такого юзера не существует!<br/><a href=\"enter.php?id=$id&pass=$pass&ref=$rand&cid=$cid\">В прихожую</a><br/>";
} else {
$data=@mysql_fetch_array($q_s);
$must=@mysql_fetch_array($q_l);
$moder=$must['moder'];
$user_moder=$data['moder'];
$admin=$must['admin'];
$to=$data['email'];
$from=$must['email'];
$photo=$data['photo'];
$status=$data['status'];
if($data['sex']=="m") { $sex = "муж"; } else { $sex = "жен"; }
print "ID: ".$data['id']." <br/>";
print "Логин: ".$data['login']." <br/>";
print "Имя: ".$data['name']." <br/>";
print "Пол: $sex <br/>";
print "День роженья: ".$data['bday']."-".$data['bmonth']."-".$data['byear']."<br/>";
print "Город: ".$data['live']." <br/>";
print "Мобила: ".$data['mobile'] ."<br/>";
print "e-mail: ".$to."<br/>";
print "WAP сайт: <a href=\"".$data['url']."\">".$data['url']."</a> <br/>";
print "ICQ: ".$data['icq']." <br/>";
print "Статус: $status <br/>";
print "Посты: ".$data['posts']." <br/>";
print "О себе: ".$data['about']." <br/>";
print "Дата регистрации: ".$data['regdate']." <br/>";
print "<br/><a href=\"search.php?id=$id&pass=$pass&cid=$cid&ref=$rand\">Искать ещё</a><br/>***<br/>";
print "<a href=\"enter.php?id=$id&pass=$pass&cid=$cid&ref=$rand\">В прихожую</a><br/>";
}
}
}
?>
</p>
</card>
</wml>
<?
mysql_close($link);
?>