View file pages/ip.php

File size: 2.52Kb
<?php
#-----------------------------------------------------#
#          ********* WAP-MOTORS *********             #
#             Made by   :  VANTUZ                     #
#               E-mail  :  [email protected]             #
#                 Site  :  http://pizdec.ru           #
#             WAP-Site  :  http://visavi.net          #
#                  ICQ  :  36-44-66                   #
#  Вы не имеете право вносить изменения в код скрипта #
#-----------------------------------------------------#	
require_once"../template/start.php";
require_once"../template/regglobals.php";
require_once"../template/config.php";
require_once"../template/functions.php";
require_once"../template/antidos.php";
require_once"../template/cookies.php";
require_once"../template/gzip.php";
require_once"../template/header.php";
require_once"../template/referer.php";
include_once"../themes/$config_themes/index.php";
include_once"../template/isset.php";

echo '<img src="../images/img/motors.gif" alt=""> <b>География по IP</b><br><br>';

if(isset($_POST['ipsearch'])) {$ipsearch=check($_POST['ipsearch']);}else{$ipsearch=$_SERVER['REMOTE_ADDR'];}

$strl=strlen("ip=".$ipsearch);
		$header = "POST http://www.gzq.ru HTTP/1.1\n".
                "Host: www.gzq.ru\n".
                "Content-type: application/x-www-form-urlencoded\n".
                "Content-Length: ".$strl."\n\n".
                "ip=".$ipsearch."\n";
if (($conn = fsockopen( "www.gzq.ru", 80, $error, $errstr, 5)) == 0) return false;
fputs ($conn, $header);
$answer = "";
while (!feof($conn)) $answer .= fgets($conn);
fclose ($conn);

$res=utf_to_win("Результат MaxMind GeoIP");


if(!ereg($res,$answer)) {
$GrabStart = utf_to_win("<h2>Результат Geo Zone Query:</h2>");
} else {
$GrabStart = utf_to_win("<h2>Результат MaxMind GeoIP:</h2>");
}
$GrabEnd = utf_to_win("Широта: ");
$GrabData = eregi("$GrabStart(.*)$GrabEnd", $answer, $Dataecho);
$Dataecho = trim(strip_tags($Dataecho[1],"<br>"));

$Dataecho=win_to_utf($Dataecho);

if(stristr($Dataecho, 'Страна:   <br>')){
$Dataecho='По вашему IP '.check($ipsearch).' ничего не найдено!<br>';
}

echo $Dataecho;

echo '<br><br><form action="ip.php?'.SID.'" method="post">';
echo 'IP: <input type="text" name="ipsearch" value="'.check($ipsearch).'">';
echo '<input type="submit" value="Узнать город">';
echo '</form>';


include_once "../themes/$config_themes/foot.php";
?>