Jump to content
php.lv forumi

$_SERVER['REMOTE_ADDR']


fresh

Recommended Posts

Lieta taada,ka uzraxtiju vienkaarshu viesu graamatas skriptinju un saakumaa palaidu uz eclub servuka - viss straadaaja, tagad paarliku uz jauna servuka un skriptaa,kas veido ieraxtu (shajaa gadiijumaa texta failaa), $_SERVER['REMOTE_ADDR'] veertiiba ir kaut kaada ieksheejaa adrese 10.0.... ,nevis klienta IP?

Kaapeec taa, un kas buutu labojams?

Link to comment
Share on other sites

$full_ip=(isset($_SERVER['REMOTE_ADDR'])?$_SERVER['REMOTE_ADDR']:'').

(isset($_SERVER['HTTP_X_FORWARDED_FOR'])?';'.$_SERVER['HTTP_X_FORWARDED_FOR']:'').

(isset($_SERVER['HTTP_CLIENT_IP'])?';'.$_SERVER['HTTP_CLIENT_IP']:'')."\n";

 

plus

echo '<pre>'.print_r($_SERVER,1).'</pre>';

un skatāmies vai tik nav vēl kaut kas interesants

Link to comment
Share on other sites

Shai gan izskataas ka IP adrese klientam neraadaas deelj tiikla/apache konfiguraacijas.

 

Proti izskataas ka reaali webserveris griezhaas uz kaut kaadas ieksheejaas kastes/interfeisa:

 

[sERVER_ADDR] => 10.0.0.146

 

Un pie taas griezhas aareejais serveris kam ir gan iekshejaa gan aareejaa tiikla interfeiss

Proti aareejaa IP 194.19.228.134 bet ieksheejais interfeis

[REMOTE_ADDR] => 10.0.0.139 kas attieciigi taisa pieprasiijumu taalaak.. Uz reaalo php skriptu/apachi.

 

Liidz ar to php skripts klientu IP vietaa redz itkaa aareejo serveri - kas gan ir gauzhaam nelabi un vajadzeetu to risinaat pie administratora.

Link to comment
Share on other sites

×
×
  • Create New...