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 juglesh on 01/11/06 05:49

Venturer wrote:
> include("http://www.master.com/script.php");
>
> the script.php checks for the domain it is on (which should tell it its
> on www.2.com/index.php) and then makes sure it WONT display its own
> domain in the script.php list... eg it will show 1.com and 3.com but
> not 2.com
>
> Of course what happens is that the domain test comes back as saying its
> on http://www.master.com
>
> How else can I do this and not have to update 50 websites when I want
> to make a common change to one file?

Ah, you might be looking for the "Non-Standard File Extension" Try

include 'http://www.remotedomain.com/script.xyz';
this script should have open/close php tags.

You can use the $_SERVER array in script.xyz as if it were on the
includer domain. I use this all the time to put hit counter code, etc
in my sites.

Do be aware, anyone could browse to www.remotedomain.com/script.xyz and
see the raw php code, so you shouldnt use this for anything secret.

--
juglesh

 

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

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