On 8/27/2012 3:17 PM, Jack S wrote:
Hello All,

Trying to figure out why when I include the page that contains this
code, I'm not able to get the $calling_page populated with any values.
Any help appreciated...

# Dynamic Content based in page
$calling_page = $_GET['page'];

# Home Page 
if(!($calling_page)) {
         $title = "Title 1 - $calling_page";
                $body = "<body />";

} elseif ($calling_page == "index") {
         $title = "Title 2 - $calling_page";
                $body = "<body />";

# Non Specified Page
} else {
         $title = "Title 3 - $calling_page";
                $body = "<body />";


echo "<title>".$title."</title>";

Since this code does nothing other than assign a value to $calling_page based upon the content of a GET variable, what do you mean by "not able to get the $calling_page populated with any values.".

Are you simply saying that "$calling_page does not have a value assigned to it"? And if that is what you meant to say, then the answer is that your GET array does not contain an index of 'page'. Of course, even if that were true, you would in fact have a value in $calling_page and it would be simply: "Title 1 - ".

PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to