suyesh.amatya Posted July 18, 2008 Share Posted July 18, 2008 Referrer Site(referrerSite.php): IP:192.168.0.104 code in referrer site is: <a href="http://192.168.0.103">Link to destination site</a> Destination Site(destinationSite.php): IP:192.168.0.103 code in destination site is: <pre> This is the Referrer Site. <?=$_SERVER['HTTP_REFERER'];?> </pre> <pre> This is the address of the Referrer Site. <?=$_SERVER['REMOTE_ADDR'];?> </pre> In the LAN, Referrer Site and Destination Site are in two different computers. What I need is, by clicking the link in the referrer site, I want the referrer's URL(domain) and IP in the destination site. But what I am getting is: On Referrer site browser: This is the Referrer Site. http://localhost/referrerSite.php This is the address of the Referrer Site. 192.168.0.104 On Destination site browser: This is the Referrer Site. http://localhost/destinationSite.php This is the address of the Referrer Site. 127.0.0.1 What I want on the destination site is being displayed on the Referrer site.Seems like referrer site is remotely executing the script in the destination site. can anyone suggest me idea with no code change in the referrer site,provided that you can change the destination site code.I ' d be very grateful. Link to comment https://forums.phpfreaks.com/topic/115364-interesting-thing-but-need-help/ Share on other sites More sharing options...
samshel Posted July 18, 2008 Share Posted July 18, 2008 <?=$_SERVER['REMOTE_ADDR'];?> gives the IP used by APACHE, if you use localhost as the domainname, it will return 127.0.0.1. Try adding a virtual host and assing the IP of the machine to that. Link to comment https://forums.phpfreaks.com/topic/115364-interesting-thing-but-need-help/#findComment-593133 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.