I have a PHP file which is loaded with the following on another site: <? Php read file ("http://abc.com/xxxx.php");?> Can you write something into the PHP-file(http://abc.com/xxxx.php) which shows the URL of the site where the file is loaded? I've tried using $_SERVER['PHP_SELF']; but it does not work, I think it's because it is run through the readfile Any ideas ?
well assuming xxxx.php exists within the root/base directory, you can do: <?php readfile("http://{$_SERVER['HTTP_HOST']}/xxxx.php");?> PHP:
The idea is good. But I can not check if $ _SERVER ['HTTP_HOST'] will be manually changed. Therefore it's best the feature is located inside the PHP file (http://abc.com/xxxx.php)
You need to enable the "allow_url_include" directive in php.ini. More on it: http://php.net/manual/en/features.remote-files.php
file_get_content is more usefull,but still you should check php.net for help with setting php.ini to remote file inclusion