Jump to content
php.lv forumi

IP noteikšana


Devils666

Recommended Posts

sveiki, tātad es izmantoju šo skriptu IP noteikšanai:

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

tas ir labakais variants?

man viņu nepieciešams pārveidot, tā lai rādītu tikai pašu IP adresu, bez visiem fwd vai via, lai nebutu ta:

xxx.xxx.xxx.xxx via 1.1 new-br

bet gan:

xxx.xxx.xxx.xxx

 

kā varētu parvaidot, lai parāda galveno ip adresi, kas tiek noteikta...

vienkārši negribu kaut ko lieku noņemt..

Edited by Devils666
Link to comment
Share on other sites

Sanāk, ka reģistrēsi manu iekšējā tīkla IP adresi, ja eju caur proxy:

192.168.*.*

10.*.*.*

Tev to vajag?

 

+ neviens man neliedz rakstīt zilus brīnumus tajā X_FORWARDED_FOR headerī... Un REMOTE_ADDR, kuru tik viegli vis nevar mainīt, Tu vispār atmetīsi...

Link to comment
Share on other sites

Sanāk, ka reģistrēsi manu iekšējā tīkla IP adresi, ja eju caur proxy:

192.168.*.*

10.*.*.*

Tev to vajag?

 

+ neviens man neliedz rakstīt zilus brīnumus tajā X_FORWARDED_FOR headerī... Un REMOTE_ADDR, kuru tik viegli vis nevar mainīt, Tu vispār atmetīsi...

Hmm, nu es no ši tik labi nesaprotu, bet tāda gadījuma ko tu iesaki?

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...