You are here: Re: How to get url of current url from included script on different server « PHP Programming Language « IT news, forums, messages
Re: How to get url of current url from included script on different server

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация