Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
August 19, 2005, 9:34 pm
rate this thread
- Malcolm Dew-Jones
August 19, 2005, 11:38 pm
Re: is there any way to find what the domain name is for the site that my script might be running on?
: I need for my script to be able to find out what the domain name is for
: the site that it is running on. I looked through the $_SERVER vars, but
: didn't see anything.
I put the following in my doc area, called it "phpinfo.php", and browsed
On my machine I see I have environment variables called
I forget how to access the environment from php, but I'm sure it's easy,
and it might change on different php versions anyway. You should have
something similar, though it will also depend on the web server software.
_HOWEVER_, a web server machine does not have to have a name, so you can
not depend 100% on finding a name at all. You might need to settle for an
This space not for rent.