Posted by Andy Jeffries on 04/28/06 16:30
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
[Back to original message]
|