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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T09:29:57+00:00 2026-06-12T09:29:57+00:00

i am populating a form from mysql. code is. . task.php <div data-role=content> <h2>

  • 0

i am populating a form from mysql. code is. .

task.php

<div data-role="content">
               <h2> Please select cars </h2>
<form method="post" action="cars.php">
            <?php 
            $carq = "select * from cars";
            $executecars = mysql_query($carq);
            while($row=mysql_fetch_assoc($executecars)){
                $cname = $row['name'];  
                ?>

               <label for="<?php echo $cname; ?>"><?php echo $cname; ?></label>
               <input type="checkbox" name="car" id="<?php echo $cname; ?>" value="<?php echo $cname; ?>"/>

            <?php }     

            ?>
           <input type="submit" name="submitcars" id="submitcars" value="View Details"/>
           </form>
         </div>

now in cars.php i want to make a query to display the details of car selected,

<div data-role="content">
        <?php 
            if(isset($_POST['submitcars'])){

                echo $_POST[$cname];?????????????


                }
        ?>

        </div>

now how to process the form here in cars.php ?

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-12T09:29:58+00:00Added an answer on June 12, 2026 at 9:29 am

    Make car attribute array::

    <input type="checkbox" name="car[]" id="<?php echo $cname; ?>" value="<?php echo $cname; ?>"/>
    

    and get them on next page with

    if(isset($_POST['submitcars'])){
       foreach($_POST['car'] as $car){
           // do something with $car
       }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a Codeigniter way of populating a form with data from the database?
I am populating form variables from a database. If the field value has a
There is an example of getting data from form using mapper in official quickstart
I've created a form and populating its value from Category model in drop down
I need an example for populating the dojo grid with the data coming from
I'm stuck with populating Ext.form.Panel with data in my MVC project. In Controller I
I am having trouble populating a Javascript variable from PHP. My index.php file is
I'm populating the choices of a form choicefield in django, it's a year select
I am populating a Select form element, and if I try to use HTML
So I have this MySQL 5.0.24 table select state, county, population from state_pops order

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.