RE: [PHP] determining script url
| From: | sean at interconnect dot is dot it | Date: | Fri, 08 Feb 2002 16:17:50 +0000 |
| Subject: | RE: [PHP] determining script url | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-84006@lists.php.net to get a copy of this message | ||
Thanks for the response, but those are just like $DOCUMENT_ROOT, they provide paths in the server, I
need what is showing up as the URL in the browser - i.e. http://www.domain.com/script.php - or if there is no
domain, to give me the IP.
any ideas? I can't seem to piece it together with the info from phpinfo() either.
It's so aggravating because the value of what I'm looking for is right on screen, but I
can't get the php to notice!
Thanks,
Sean
My response for those vars was:
$SCRIPT_NAME: /cgi-bin/php4.cgi
$SCRIPT_FILENAME: /u/httpd/cgi-bin/php4.cgi
-----Original Message-----
From: Matt Williams [mailto:matt@yewlands.com]
Sent: Friday, February 08, 2002 1:00 AM
To: sean@interconnect.is.it; php-general@lists.php.net
Subject: RE: [PHP] determining script url
> Hi all,
> How can I get the full URL of the currently running script?
> $DOCUMENT_ROOT is not what I need, instead I need the url (be it
> domain if exists, or ip if not). $SERVER_NAME works but if a
> domain isn't paired with the server, I could get some useless
> information (right?).
$SCRIPT_NAME or $SCRIPT_FILENAME
See http://uk.php.net/manual/en/language.variables.predefined.php
For more details
m: