|
Posted by Kim Andrι Akerψ on 04/06/06 14:04
haggis@_your_teeth_nerdshack.com wrote:
> I've had a trawl through php.net and either I'm searching with the
> wrong question or I'm not understanding the answers.
> I'm trying to go -
> parse_url($php_self)
> to list the page, and then from that extract the domain, any
> particular script is on. As I'm not having much luck, I must be
> using the wrong code.
> Is there a one-liner in php which would do that for me?
> Remove _your_teeth_ to reply.
As the PHP manual states, parse_url doesn't work on relative URLs, and
it's "not meant to validate the given URL, it only breaks it up into
the above listed parts".
If you're just trying to find the hostname/domain where the script has
been access, check the variable $_SERVER["HTTP_HOST"].
--
Kim AndrΓ© AkerΓΈ
- kimandre@NOSPAMbetadome.com
(remove NOSPAM to contact me directly)
Navigation:
[Reply to this message]
|