Re: Validation problem with array.
| From: | Andre Dubuc | Date: | Thu, 21 Oct 2004 09:38:21 +0000 |
| Subject: | Re: Validation problem with array. | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-199961@lists.php.net to get a copy of this message | ||
Hi Stuart,
I haven't followed your thread too closely, but I did see something that might
be the cause of your problems:
[snip]
> Let me show you how I set it all up. Remember it's a
> multi page form:
> So the form elements are: skills[], skys[], slus[]
> Then on the next page I have to still pass the session
> variables, and so:
>
> $_SESSION['skills'] = $_POST['skill'];
> $_SESSION['skys'] = $_POST['sky'];
> $_SESSION['slus'] = $_POST['slu'];
>
> Now the transcation script:
>
> $skills = $_SESSION['skills'];
> $skys = $_SESSION['skys'];
> $slus = $_SESSION['slus'];
>
> foreach($_SESSION['skills'] as $key => $skill)
^^ ^^
[snip]
It's my understanding that where I've put ^^ should be enclosed by braces,
otherwise you'll get some starnge behaviour.
I'm puzzled why you reverted to $_SESSION['skills'] when the line above you've
set $skills = $_SESSION['skills']??
HTH,
Andre