Jump to content
php.lv forumi

IP adreses nolasīšana/nenolasīšana


Rich Bitch

Recommended Posts

function get_IP()
{

return (empty($_SERVER['HTTP_CLIENT_IP']) ? (empty($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['REMOTE_ADDR'] : $_SERVER['HTTP_X_FORWARDED_FOR']) : $_SERVER['HTTP_CLIENT_IP']);

}

 

Es pašlaik izmantoju tādu metodi, bet, šķiet, ka šī metode anv 100% pilnīga... :( Kāds nevēlās to savest kārtībā?? :D

Link to comment
Share on other sites

Cik pētīju, ir vēl $_SERVER[] mainīgie, kas varētu teorētiski "atgriezt" IP, ja lietotājs ir "paslēpies" kādā netradicionālā veidā... :)

Link to comment
Share on other sites

$check = array(
	'HTTP_X_FORWARDED_FOR', 'HTTP_X_FORWARDED', 'HTTP_FORWARDED_FOR',
        'HTTP_FORWARDED', 'HTTP_VIA', 'HTTP_X_COMING_FROM', 'HTTP_COMING_FROM',
        'HTTP_CLIENT_IP'
      );

tad mauc ciklā cauri...

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...