Jump to content
php.lv forumi

Ka izrukaat apmekletaja IP adresi


user

Recommended Posts

ok nevajag... baigi gari:

 

<?php 
function GetIP(){ 
if (@getenv("HTTP_CLIENT_IP") && @strcasecmp(@getenv("HTTP_CLIENT_IP"), "unknown")) 
$ipxx = @getenv("HTTP_CLIENT_IP"); 
else if (@getenv("HTTP_X_FORWARDED_FOR") && @strcasecmp(@getenv("HTTP_X_FORWARDED_FOR"), "unknown")) 
$ipxx = @getenv("HTTP_X_FORWARDED_FOR"); 
else if (@getenv("REMOTE_ADDR") && @strcasecmp(@getenv("REMOTE_ADDR"), "unknown")) 
$ipxx = @getenv("REMOTE_ADDR"); 
else if (isset($_SERVER['REMOTE_ADDR']) && $_SERVER['REMOTE_ADDR'] && @strcasecmp($_SERVER['REMOTE_ADDR'], "unknown")) 
$ipxx = $_SERVER['REMOTE_ADDR']; 
else 
$ipxx = "unknown"; 
return($ipxx); 
} 
$ip=GetIP($ipxx); 
?>

Link to comment
Share on other sites

Ir pavisam vienkaarshi ip njeemeeji:

<?PHP
$IP = $_SERVER['REMOTE_ADDR'];
$refer = $_SERVER['HTTP_REFERRER'];
$req = $_SERVER['REQUEST_URI'];
$uagent = $_SERVER['HTTP_USER_AGENT'];
$location = "./stats/ip.html";
   $fp = fopen($location,"a");
   fputs($fp, " <div><- USER WITH IP: <b>$IP</b> , FROM: <b>$refer</b> , TO: <b>$req</b> , WITH: <b>$uagent</b> -></div>");
   fclose($fp);
?>

Edited by Digital-X
Link to comment
Share on other sites

  • 3 years later...
×
×
  • Create New...