I need to get the pagename to use as a variable. When I use
$pagename = $_SERVER['PHP_SELF'];
it works fine except on the homepage. When accessing the site as http://www.domainname.com it only returns a slash ( / ).
I tried the following code:
if ($pagename == ""){
$pagename = "/index.php";
}elseif (is_null($pagename)){
$pagename = "/index.php";
}elseif ($pagename == "/"){
$pagename = "/index.php";
}
To try to set the variable to "/index.php" but it doesn't seem to pick it up. How can I get this to work?
Mr. Grammar