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

  • Home
  • SEARCH
  • 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 8238203
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T19:43:53+00:00 2026-06-07T19:43:53+00:00

Can I use PHP checkbox array with the GET Method? And if there are

  • 0

Can I use PHP checkbox array with the GET Method?
And if there are two checkboxes clicked, will that result in: some.php?param=1&param=2 ?

As you know, I am not used to write into database, I’m just getting the parameters. Thanks.

  • 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-06-07T19:43:56+00:00Added an answer on June 7, 2026 at 7:43 pm

    You need to pass the checkboxes with the same field name followed by [] so PHP recognizes the array.

    Like so:

    <input type="checkbox" name="foo[]" value="bar1">
    <input type="checkbox" name="foo[]" value="bar2">
    <input type="checkbox" name="foo[]" value="bar3">
    

    So the GET would be:

    phpfile.php?foo[]=bar1&foo[]=bar2&foo[]=bar3
    

    if every checkbox is clicked. (POST similar)

    Please note, that only the clicked checkboxes will be submitted. So, if just bar1 and bar2 are clicked, then the GET would be

    phpfile.php?foo[]=bar1&foo[]=bar2
    

    Then you can access that array via

    $_GET["foo"]
    

    or similar to POST

    $_POST["foo"]
    

    Hope that helps 🙂

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

Sidebar

Related Questions

Is there a php function that someone can use to automatically detect if an
I'm trying to install the PECL extension pecl_http so that I can use PHP's
I have a .NET DLL containing functions that I can use in PHP. Though
In PHP I can use a foreach loop such that I have access to
Using PHP's Image and GD functions you can use the following method to finally
i've read that you can use either javascript or php with google maps api.
How can I use php to download an image from URL (eg: https://www.google.com/images/srpr/logo3w.png )
I'm a bit confused with this: can I use PHP variables in a pg
Solution Edit: Turns out you can't use the PHP SDK to return the correct
Can someone tell/show me how to use PHP inside PHP. I'm trying to make

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.