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

The Archive Base Latest Questions

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

I have a form on the page. It has too many things like checkboxes

  • 0

I have a form on the page. It has too many things like checkboxes and text fields and dropdowns.
But when I don’t select one of the checkboxes, the PHP page where i catch the form shows me an error.

Example:

The HTML Code:

Checkbox 1<input type="checkbox" name="check1" value="on" />
Checkbox 2<input type="checkbox" name="check2" value="on" />

The PHP Code:

$check1 = $_GET['check1'];
$check2 = $_GET['check2'];

It works fine if both the items are selected and sent in the URL:

localhost/project/checkbox.php?check1=on&check2=on

But when i deselect 1 of them, suppose check2, then the URL is like this:

localhost/project/checkbox.php?check1=on

and it shows me an error – that $check2 is an undefined index.

But I don’t want it to show the error if the checkbox is not being selected. I also tried an if statement to check if i’m getting it in the URL but it didn’t work.

Is there a way to first check weather the data is being passed in the URL or not? As I don’t get the error.
Actually the error is not the main thing, as I’m getting right results and I know I can switch off error reporting in php.ini, but thats not what I want to do. I want it to first check if data is coming in?

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-05-20T17:26:21+00:00Added an answer on May 20, 2026 at 5:26 pm

    if (isset($_GET['check2']) && !empty($_GET['check2']) will do the check if check2 GET parameter is present and is not empty.

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

Sidebar

Related Questions

I have a form that has many checkboxes (too many for it to make
I have a form on a page where the user has inputs to edit
I have a ASP.NET page which has a form on it. It also has
I have an ASP.NET page which has a script manager on it. <form id=form1
I would like to have an aspx page that contains something like.... <form id=form1
My page is a bulk order form that has many products and various size
I have to fill in multiple form fields on a web page I got
I have a form on an HTML page with multiple submit buttons that perform
I have a simple form on a view page, implemented as a user control,
I have a Drupal module page where I am populating a form with a

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.