Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6792347
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T17:57:28+00:00 2026-05-26T17:57:28+00:00

NOTE : It’s sort of hard to google for this, because GET is bringing

  • 0

NOTE :

It’s sort of hard to google for this, because “GET” is bringing up a lot of “how to ‘get’ the value of a form with javascript,” etc.

PROBLEM :

TL;DR version first

Can you use a multi-select from with the GET method of a form and still retrieve each individual value?

extended explanation

The requirements of a searchable catalog I’m building include using the GET method with the form, so that the user can see their results in the url, and also send a direct link to the search results to another customer, etc.

One of the searchable fields is a multi-select box (a select box with the MULTIPLE attribute). My back end is written in PHP, and I usually handle a multi-select by setting the name to an array variable (name="multiselect[]") and the post variable includes an array of the selected options ($_POST["multiselect"] == array()).

The problem in this case is that the multi-select values are passed to the get string like this:

action?multiselect=1&multiselect=2

So whatever the last value is replaces the value of the first initialization of the variable in the get string. (in the above example, multiselect would equal “2”).

Trying to make the name an array just makes the array value replaced in the same manner, like this

action?multiselect[]=1&multiselect[]=2

Will result in $_GET["multiselect"] == 2

I had originally recommended using a checkbox, as it would allow us to name the elements differently and check for true/false on each one, but there are around 30 values for this particular multi-select, and they want it to be in a scroll-able area.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T17:57:29+00:00Added an answer on May 26, 2026 at 5:57 pm

    Works for me. Just tried

    http://www.nearby.org.uk/tmp/multi-test.html

    <select name="multiselect[]" ...
    

    Results in a URL
    ?multiselect%5B%5D=2&multiselect%5B%5D=3

    which will make $_GET[‘multiselect’] an array in PHP.

    Perhaps you have something else in your system, stripping the [] ?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

(note: the_geom is a geometry value (TYPE: LINESTRING), in this case i random them
(Note: This is with IIS7) When I go to http://localhost/MyApp , I get a
Note: This was posted when I was starting out C#. With 2014 knowledge, I
Note: Originally this question was asked for PostgreSQL, however, the answer applies to almost
Note : The code in this question is part of deSleeper if you want
(Note: This is for MySQL's SQL, not SQL Server.) I have a database column
Note This is not a REBOL-specific question. You can answer it in any language.
Note: I've read this and its not quite what I'm looking for: I have
NOTE Due to the successful outcome of this thread, the documentation at the provided
Note the tag: VBA , not VB6, not VB.NET. This is specific to VBA

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.