Jump to content
php.lv forumi

Recommended Posts

Posted

vai ir iespējams noteikt datora īsto IP adresi, pat ja konekcija ir caur PROXY serveri?

der variants gan ar PHP, gan ar kādu linux softu. (protams ja tas ir iespējams)

varbūt kaut ko var no apache hederiem dabūt?

Posted

Ja ir anonīmais proxy, tad nevar.

Vienīgi , ja tiek lietots caurspīdīgais(transparent), tad var.

Posted
Un ja lietotājs lieto transparent proxy, tad reālo IP adresi var noteikt ar to pašu: $_SERVER['REMOTE_ADDR']; ?

13146[/snapback]

$_SERVER['HTTP_X_FORWARDED_FOR']

Posted

//get IP as: stated IP;proxy forward/behind proxy IP:proxy

$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']:'');

×
×
  • Create New...