Re: Self referencing
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.php archive

Re: Self referencing

From: Andy Jeffries <news@andyjeffries.co.uk>
Date: Fri Apr 28 2006 - 15:30:50 CEST

On Fri, 28 Apr 2006 21:03:54 +0800, TreatmentPlant wrote:
> How can I write a PHP code to find the URL on which the code the itself is
> running?

If you're running PHP as an Apache module, use $_SERVER["REQUEST_URI"].
You can combine this with $_SERVER["HTTP_HOST"] if you run it on different
hostnames (and that's important to you).

Cheers,

Andy

-- 
Andy Jeffries MBCS CITP ZCE   | gPHPEdit Lead Developer
http://www.gphpedit.org       | PHP editor for Gnome 2
http://www.andyjeffries.co.uk | Personal site and photos
Received on Mon May 1 03:06:43 2006