Hi - I have a php script that generates a header on the top of several pages. I’m looking for the right way to code:
- If this page is index.php, display X
- If this page is not index.php, display X
Any help would be appreciated!
Thanks
-Kal
Hi - I have a php script that generates a header on the top of several pages. I’m looking for the right way to code:
Any help would be appreciated!
Thanks
-Kal
[php]
$farr = Explode(’/’, $_SERVER[“SCRIPT_NAME”]); $file = $farr[count($farr) - 1];
if($file==‘index.php’)
{
// action 1
}
else
{
// action 2
}
[/php]
or
[php]
$file = pathinfo($_SERVER[‘PHP_SELF’]);
if($file[‘basename’] == ‘index.php’)
{
// action 1
}
else
{
// action 2
}
[/php]