Re: get question

From: Date: Mon, 27 Aug 2012 19:56:34 +0000
Subject: Re: get question
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-318881@lists.php.net to get a copy of this message
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 - ".

« previous php.general (#318881) next »