|
Posted by Oli Filth on 01/10/06 16:40
Venturer said the following on 10/01/2006 09:52:
> I have a banner script that is included in php on a website but the
> actual script is hosted on a different site allowing me to only edit
> one file to update the script.
>
> I need to store in a variable the hostname that the included script is
> being run on NOT the master url where it is hosted.
I'm assuming you're include()-ing the script as something like:
include("http://remote.server.example.com/script.php");
Is the remote server set to execute PHP or not?
* If it is, then script.php is being run on the remote server, not the
local server, so you're actually include()-ing the *output* of
script.php, not the PHP code itself. In which case, you will need to
either pass the hostname in the request for script.php, e.g.:
include("http://remote.server.example.com/script.php?host=http://local.example.com/mainscript.php");
* If the remote server is not set to execute PHP, then script.php will
be executed on the local server, so there should be no problem. However,
this configuration is a potential security risk, as anyone can request
script.php and see the code.
--
Oli
[Back to original message]
|