Mr. server url

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
cheatboy00
Forum Contributor
Posts: 151
Joined: Sat Jun 29, 2002 10:36 am
Location: canada
Contact:

Mr. server url

Post by cheatboy00 »

o.k. I'm trying to get the server part of the url, of where the person is.... and if its something then include a file...

I know about $PHP_SELF gets you the folder and the file... but i duno how to get the server....

Code: Select all

$url = ""; // the server

// note the url below is not real and just an example
if ($url == "http://sub.wordopen.com/") {
} else {
   include ("stop.php");
}
um... also note that the file thats going to contain this code is in a frame... so it has to get the top url, not the current frame url.
User avatar
RandomEngy
Forum Contributor
Posts: 173
Joined: Wed Jun 26, 2002 3:24 pm
Contact:

Post by RandomEngy »

$_SERVER['HTTP_HOST']
User avatar
cheatboy00
Forum Contributor
Posts: 151
Joined: Sat Jun 29, 2002 10:36 am
Location: canada
Contact:

Post by cheatboy00 »

sweet.... thanks a bunch.
Post Reply