Results 1 to 2 of 2

Thread: repeating $_GET keys [Resolved]

  1. #1

    Thread Starter
    Frenzied Member ober0330's Avatar
    Join Date
    Dec 2001
    Location
    OH, USA
    Posts
    1,945

    repeating $_GET keys [Resolved]

    I'm taking input from a select box where multi is set to true. So my url looks like:
    http://xxxxxxxx/folder/step2.php?fields=1N_ModeHeader.A_OR_B_END&fields=2N_ModeHeader.COMMENTS&fields=3N_ModeHeader.COMP_A_ R&mode=1&s=Submit
    How do I get all the "fields" values? Right now it's only printing out the last one.
    Last edited by ober0330; Jul 15th, 2004 at 09:39 AM.
    format your code!! - [vbcode] [/vbcode]

    ANSWERS CAN BE FOUND HERE!!

    my personal company

  2. #2

    Thread Starter
    Frenzied Member ober0330's Avatar
    Join Date
    Dec 2001
    Location
    OH, USA
    Posts
    1,945
    Nevermind, I got it. I had to make the name of the select box an array: fields[].

    Then to print them out, it was just:
    PHP Code:
        foreach($_GET['fields'] as $key2)
        {
            echo 
    "<option value=" $key2 ">" $key2 "</option>";
        } 
    format your code!! - [vbcode] [/vbcode]

    ANSWERS CAN BE FOUND HERE!!

    my personal company

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width