Hi, Here is what I want to do. Thanks in advance for the help! 1) I want to use <?php readfile("http://othersite.com/names.php") ?> on mysite.com. 2) I want it to JUST display the text "mysite.com". 4) I want to use the same <?php readfile("http://othersite.com/names.php") ?> on mysite2.com 5) I want it to JUST display the text "mysite2.com". So ideally, the readfile would say something like.. IF the domain "mysite.com" is accessing this readfile, please give them the text "mysite.com". IF the domain "mysite2.com" is accessing this readfile, please give them the text "mysite2.com" How can I make this possible? Basically, I want the value of readfile to change depending on the site accessing it. It's okay if I have to use something other than readfile, just tell me what and how! Thank you!
Hey, Not exactly sure what your trying to do, but if I understand right; You can do: // othersite.com ~ names.php print $_GET['site']; // mysite.com readfile('http://othersite.com/names.php?site=mysite.com'); // will output "mysite.com" // mysite2.com readfile('http://othersite.com/names.php?site=mysite2.com'); // will output "mysite2.com" PHP:
In names.php to have to check the IP of the mysite.com, mysite2.com somehting like this: if(IP_mysite) { echo "mysite.com"; } elseif(IP_mysite2) { echo "mysite2.com"; } Code (markup):