How can I check if the client is on the front page?
What I've tried
$CURRENT_URL = "http://". $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
if($CURRENT_URL == "http://domain.com")
{
...
}
How can I check if the client is on the front page?
What I've tried
$CURRENT_URL = "http://". $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
if($CURRENT_URL == "http://domain.com")
{
...
}
Just check the request URI:
if ($_SERVER["REQUEST_URI"] === "/")