vanishing variable
| From: | Hugh Danaher | Date: | Thu, 30 Aug 2001 08:25:39 +0000 |
| Subject: | vanishing variable | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-65180@lists.php.net to get a copy of this message | ||
I've gotten the year from the following code on page one:
date_array=getdate(); / / today's date info
foreach ($date_array as $key=>$val)
{
$key=$val;
}
$current_year=$date_array[year];
I've used the $current_year variable throughout a form on the first page and the variable is
picked up without problem everywhere it's used.
I've brought in stored data to display on this same page using $php_self in a select box, and
the $current_year variable still works fine.
Finally, I've got another select box which calls a new page using get (I tried post, and it
didn't work either), and the $current_year disappears never to be seen again. Perplexing, no?