The question can be samplified to that :
In which case $_SERVER['REMOTE_ADDR'] and $_SERVER['SERVER_ADDR'] will return the seem value ? of course i am talking about live site not localhost.
Search found 3 matches
- Fri Feb 28, 2014 8:40 am
- Forum: PHP - Code
- Topic: How to distinguish client ip from server ip on localhost
- Replies: 4
- Views: 1843
- Fri Feb 28, 2014 7:50 am
- Forum: PHP - Code
- Topic: How to distinguish client ip from server ip on localhost
- Replies: 4
- Views: 1843
Re: How to distinguish client ip from server ip on localhost
Hi; in test1.php i have : <?php header("Location: /test2.php"); ?> in test2.php i have : <?php $req = $_SERVER['REMOTE_ADDR'] . "=" . $_SERVER['SERVER_ADDR'] . "\n"; file_put_contents("ipsfrst.txt", $req); ?> In this case and when a normal visitor visits the t...
- Thu Feb 27, 2014 6:52 pm
- Forum: PHP - Code
- Topic: How to distinguish client ip from server ip on localhost
- Replies: 4
- Views: 1843
How to distinguish client ip from server ip on localhost
Hi, I am working with a php script that did different tasks based on the ip accessing it with, the script looks like that : if ($_SERVER['REMOTE_ADDR'] == $_SERVER['SERVER_ADDR']) { // do tasks here } else { // do some other tasks here } I am working on ubuntu in localhost, both $_SERVER['SERVER_ADD...