Jump to content

Get site URL?


sgt_fireman

Recommended Posts

Hey guys, So I'm wanting to get the site URL, but only the domain name part... for example,

 

if the page a user was on is,

www.example.com/test.php

 

I'de want to just be able to get the

www.example.com
part, without the test.php,

 

Up to now I've tried both

$_SERVER["REQUEST_URI"] 

and

$_SERVER["PHP_SELF"]

however these both just output the test.php part,

 

I don't know any more things that could do this.. and I can't find any of them on google so? Does anyone know anything about doing this? Thanks for the help guys!

Link to comment
https://forums.phpfreaks.com/topic/266500-get-site-url/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.