Jump to content
php.lv forumi

ip kods


pro_killer

Recommended Posts

te pat voruma Mr. Venom padalījās ar šādu te kodu, nosaka IP aiz prokša

<?php
function get_IP(){
$IP=(isset($_SERVER['REMOTE_ADDR'])?$_SERVER['REMOTE_ADDR']:'').(isset($_SERVER['HTTP_X_FORWARDED_FOR']) && $_SERVER['HTTP_X_FORWARDED_FOR']!='unknown'?' fwd '.$_SERVER['HTTP_X_FORWARDED_FOR']:'').(isset($_SERVER['HTTP_CLIENT_IP'])?' client_ip '.$_SERVER['HTTP_CLIENT_IP']:'').(isset($_SERVER['HTTP_VIA'])?' via '.$_SERVER['HTTP_VIA']:'');

return $IP;
}
echo get_IP();
?>

Link to comment
Share on other sites

×
×
  • Create New...