Hi,
I am trying to find out the current URL using PHP. This is what I have thus far:
$http = 'http';
if($_SERVER["HTTPS"] == "on"){
$http .= "s";
}
$http .= "://";
$url = $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
$_SESSION['siteurl'] = $http.$url;
I can't figure out how to take the filename from that. So for example it would currently return:
http://somesite.com/blah/file.php
Where as I want it to return:
http://somesite.com/blah/
Does anyone know how I could achieve this?
I am trying to find out the current URL using PHP. This is what I have thus far:
$http = 'http';
if($_SERVER["HTTPS"] == "on"){
$http .= "s";
}
$http .= "://";
$url = $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
$_SESSION['siteurl'] = $http.$url;
I can't figure out how to take the filename from that. So for example it would currently return:
http://somesite.com/blah/file.php
Where as I want it to return:
http://somesite.com/blah/
Does anyone know how I could achieve this?