Session variables and arrays
| From: | Ryan Neudorf | Date: | Tue, 29 Oct 2002 23:20:56 +0000 |
| Subject: | Session variables and arrays | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-22801@lists.php.net to get a copy of this message | ||
I'm having a problem with session variables and arrays.
I'm building a multi step sign up form and I need to store all the
variable until the final step, when they are inputed to a database. I
thought the best way to do this would be to store the contents for
$HTTP_POST_VARS in session variables. This works fine for everything
except for my array of checkboxes.
When I do a print_r($_SESSION) it displays the following for the
sessionvariable assigned to the checkboxes:
[categories] => Array (
[0] => '1';
[1] => '12';
... Etc ...
But when I run any sort of array function (is_array, foreach) on
$_SESSION['categories'] it appears that it is a scalar, not an array.
Any ideas?
- Ryan