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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T15:56:41+00:00 2026-05-23T15:56:41+00:00

I have a,b,c in a table with check boxes I want by clicking sub

  • 0

I have a,b,c in a table with check boxes I want by clicking sub button echoing value of checkboxes that are checked

<?php
 $array=array('a','b','c');
 echo "<table border=2>";
     for($i=0;$i<3;$i++)
     {
     echo "<tr>
     <td><input type='Checkbox' name='p[$i]'  value='$array[$i]' unchecked />
     <td>$array[$i]</td>
     </tr>";
     }
    echo "</table>";
if(array_key_exists('sub',$_POST))
        if(isset($_POST['p']))
         {
         foreach($_POST['p'] as $key=>$value)
             //I have problem here;
   }
?> 
<html>
<head>
<title></title>
<meta content="">
</head>
<body>
<form method='post'>
<input type='submit' name='sub' value='echome'>
</body>
</html>

I have problem in echoing and if(isset($_POST[‘p’])) is not working
what I must do?

  • 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-23T15:56:42+00:00Added an answer on May 23, 2026 at 3:56 pm

    It looks like that the table containing checkboxes is echo’ed outside the form tag, which is why ‘p’ is not submitted with form post and $_POST['p'] is not found by PHP. Move your PHP code right after the form tag is created in HTML.

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

Sidebar

Related Questions

I have a table with checkboxes and I want to do the check all
have a table that dynamically generates text boxes in run time. I want to
I have a collection of checkboxes loaded from a table that are loaded in
I have a checkboxlist.When I check one the value will appear in a table.Now
I have a user-defined table type. I want to check it's existence before editing
I have three check boxes (checkbox1 , 2 and 3) . I want to
I have table with checkboxes, which I retrieve from database : <?php $result =
I have a form in which I want two check boxes to be required
Scenario : I have say 4 check boxes and users can select those checkboxes
I have table with check boxes in it.and the CSS for the check box

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.