PHP question

Forum: ProgrammersTotal Replies: 4
Author Content
J_Maxwell

Feb 26, 2003
7:18 PM
Hello!

I have a question using PHP. I am trying to work with a . The user selects some items, and then clicks a "Step #2" button. The next page has a foreach statement that dynamically creates some text boxes. From there the user will click yet another button to continue to the final question. Basically how do I retrieve the values of the text boxes on the previous page? Since there will be more than one text box, how should I do it? I think an array might be the best bet, but again it might not.

Ideas?

J_Maxwell
J_Maxwell

Feb 26, 2003
9:12 PM
Whoops, looks like the forum took out a tag that I had in there. The second sentence should read like this (change the brackets to the less-than and greater-than statements:

I am trying to work with a [select multiple].
dave

Feb 27, 2003
10:22 AM
You are right, an array is the way to do this.

For the name of each text box, give it something like:

input type="text" name="form[name1]" value="Blah blah"
input type="text" name="form[name2]" value="Blah blah"
input type="text" name="form[name3]" value="Blah blah"

Then, the results of these will be accessible via an array: $form (or, $_POST[form]). The next page, do a print_r($_POST) and you'll see your data.

Hope that helps!

dave
J_Maxwell

Mar 06, 2003
8:27 PM
Thanks!

That was just what I needed.

J_Maxwell
dave

Mar 07, 2003
9:34 AM
Happy to help!

Posting in this forum is limited to members of the group: SITEADMINS, SUBSCRIBERS, MEMBERS.]

the Open Forums!

  Login
If you don't have an account yet, visit the registration page to sign up.

If you already have an account, you may login here:

Username: Password:

  Welcome to the Open Forums!!
Welcome to the Open Forums!!

  Hosted By...

This website is hosted by:

 -
PreparingSons
 - Titus2.com


[ Copyright © the Open Forums! | All times are recorded in ET ]

[ Contact Us ]

Login

Powered by Scif 5.3 build 285 by StandardOut, Inc.