Since your data on the client is linked, you should keep it linked on
submission by nesting an array with in the array.
Your client HTML should like something like this:
...
All the way up to skills[10][...], or however many you want. If
everything is filled out, you will then get
[snip]
> Right now I have this [right below]: If I want to
> check for skys and slus, I add another set of braces
> with if($sky != '' ...
> and below "end if ($sky != '')
>
>
> > foreach($skills as $key => $skill)
> {
> if ($skill != '' && $skys[$key] != '' &&
> $slus[$key] != '
See inline:
--- Graham Cossey <[EMAIL PROTECTED]> wrote:
> > In other words I need to figure out how to check
> > that each "line" is complete. right now, it is
> > matching all the values/inputs correctly. If
> > someone just chose a slus, seems the database
> But is this due to the sql stateme
See inline:
[snip]
>
> > > {
> > if ($skill != '') // Has this skill been
> > entered?
>
> I don't know if I care if it's been entered. My main
> concern would be to make sure that if a $skill was
> entered, then a matching $skys and $slus
> should be:
> skills[0]-baker skys[
Graham, I'm going to make those changes. Not sure if
that was creating some crazy behaviour. See inline:
--- Graham Cossey <[EMAIL PROTECTED]> wrote:
> > {
> if ($skill != '') // Has this skill been
> entered?
I don't know if I care if it's been entered. My main
concern wo
See inline:
[snip]
>
> Now the transcation script:
>
> $skills = $_SESSION['skills'];
> $skys = $_SESSION['skys'];
> $slus = $_SESSION['slus'];
>
> foreach($_SESSION['skills'] as $key => $skill)
^^^
($skills as $key => $skill)
> {
if ($skill != '') // Has
You mean why do i have $_SESSION['skills'] in the
foreach ?
Stuart
--- Andre Dubuc <[EMAIL PROTECTED]> wrote:
> 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
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
See below:
--- Graham Cossey <[EMAIL PROTECTED]> wrote:
> Also, this line :
> foreach($_SESSION['skills'] as $key => $skill)
> could read
> foreach($skills as $key => $skill)
> as you have the line:
> $skills = $_SESSION['skills'];
> Same for skys and slus.
> Graham
Graham,
I've read this over a
Yes I just found that out :).
Back to the drawing board!.
Stuart
--- Brent Baisley <[EMAIL PROTECTED]> wrote:
> I thought you were using checkboxes based on your
> true/false. So the
> user is actually typing in skills?
>
> Not sure where you are going with skill[0],
> skill[1]. You are creatin
I thought you were using checkboxes based on your true/false. So the
user is actually typing in skills?
Not sure where you are going with skill[0], skill[1]. You are creating
an associative array when you do that. In and input form, skill[0] and
skill[a] are actually no different, aside from th
Brent,
Thank you , I can't do an associative because it part
of a user input form. The values will be dependent on
the users. I'm going to try and give each form
element a index number skill[0], skill[1] since the
foreach loop is doing that anyway.
The reason I haven't posted the validation is
I think I might know what you are trying to do. You want to have a
"name" associated with the skill (or skys or slus). You can use an
associative array to "name" your array elements. In your form, you can
change the array to be something like this:
skills[cooking]
skills[flying]
skills[walking]
t;
> Also, this line :
>
> foreach($_SESSION['skills'] as $key => $skill)
>
> could read
>
> foreach($skills as $key => $skill)
>
> as you have the line:
>
> $skills = $_SESSION['skills'];
>
> Same for skys and slus.
>
> Gr
rt Felenstein [mailto:[EMAIL PROTECTED]
> Sent: 20 October 2004 14:06
> To: Graham Cossey; [EMAIL PROTECTED]
> Subject: RE: [PHP] Validation problem with array.
>
>
> My problem is not related to the insert or iteration.
> It's related to the validaton of those elements:
>
My problem is not related to the insert or iteration.
It's related to the validaton of those elements:
skill[]
skill[]
etc.
Clearer ?
Stuart
--- Graham Cossey <[EMAIL PROTECTED]> wrote:
> Not sure I really know where you have the problem,
> but I am assuming you are
> trying to construct the INS
Not sure I really know where you have the problem, but I am assuming you are
trying to construct the INSERT statement within your foreach loop.
If so, why use $_POST["skill[]"] when you have $skill which is that current
element being iterated?
Did you read the foreach doc?
http://uk2.php.net/manua
17 matches
Mail list logo