setting session variables via a form
| From: | Becoming Digital | Date: | Mon, 16 Jun 2003 15:16:45 +0000 |
| Subject: | setting session variables via a form | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-28642@lists.php.net to get a copy of this message | ||
Despite my best efforts, I can't seem to set session variables via a basic form.
I'm trying to use a button to alter display settings, which should be a simple
task, but apparently it is not. Here's the code I'm working with.
<?
if( (!isset( $_POST['view_details'] )) && ($_SESSION['item_details'] !=
"yes") )
{
print "<form method=\"post\">";
print "<input type=\"button\" name=\"view_details\"
value=\"View
Descriptions\" />";
print "</form>";
}
else
$_SESSION['item_details'] = "yes";
?>
My session I have tried a number of different solutions, including removing
session_start() from its calling function and various things I might otherwise
overlook. I'm sure that I'm overlooking something easy but I can't figure out
what it is. The session variable simply isn't being set, as confirmed by
printing its value (and by things not working!). Thanks a lot for any and all
suggestions.
Edward Dudlik
Becoming Digital
www.becomingdigital.com