Calling page and condition check?
| From: | Joey J | Date: | Mon, 16 Jun 2014 15:08:52 +0000 |
| Subject: | Calling page and condition check? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-323488@lists.php.net to get a copy of this message | ||
Hello All,
I'm calling an include of a header which contains the below code.
I want to figure out the page calling header so I created $calling_page and
when I run it, the page ECHO works but the condition never matches, nor
does the $calling_page value show up in the title.
Any ideas?
<?
$calling_page=$_SERVER['SCRIPT_NAME'];
echo $calling_page;
if ($calling_page == "/index.php") {
$title = "Page home";
} elseif ($calling_page == "/contact-us.php") {
$title = "Page -- Contact";
} else {
$title = "Default";
}
echo "<title>".$title." ". $calling_page ."</title>\n";
?>
--
Thanks!
Joey