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 942623
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T22:18:11+00:00 2026-05-15T22:18:11+00:00

Im new to PHP and Im having trouble getting a contact from to submit

  • 0

Im new to PHP and Im having trouble getting a contact from to submit multiple checkbox selections.

Here is the part of my php that handles the selections:

if(trim($_POST['interest']) == '') {
  $hasError = true;
  }
else {
  $interest = trim($_POST['interest']);
  }

And this is the part of my HTML:

<label for="interest"><strong>I'm interested in:</strong></label>
<input type="checkbox" size="" name="interest" value="Photography" /> Photography
<input style="margin-left: 20px;" type="checkbox" size="" name="interest" value="Editorial" /> Editorial
<input style="margin-left: 20px;" type="checkbox" size="" name="interest" value="Other" /> Other

I would appreciate any help on this issue. Thanks in advance!

  • 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-15T22:18:12+00:00Added an answer on May 15, 2026 at 10:18 pm

    You need to send it as an array.

    In the HTML add [] to each name field like so:

    <input type="checkbox" name="interest[]" value="...">
    

    In the PHP:

    if( isset( $_POST['interest'] ) && is_array($_POST['interest']) ) {
        foreach( $_POST['interest'] as $value ) {
            //each $value is a selected value from the form
        }
     }
    

    Hope that helps!

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

Sidebar

Related Questions

I'm having trouble translating a subroutine from Perl to PHP (I'm new to Perl).
I'm new to using SSL Certs and am having trouble getting help from the
I'm new to php and am having some trouble with inserting data across multiple
I am having trouble getting PHP web debugging setup in Eclipse. I am able
I'm having trouble getting a value from an xml string. $query_return_string contains the following
I'm having a trouble with getting the id after inserting a new Record using
I've been having some trouble getting CURL working with PHP on a server I
I'm fairly new to AJAX, so I was having a little trouble getting started.
I'm having some trouble in getting information from my itunes XML feed which you
I'm new to PHP, having trouble when I move a class definition out of

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.