Jump to content

form using php is not posting value...


rich_traff

Recommended Posts

Hi, i have written a form that uses 3 dropdown boxes, one of them being populated from a database.

 

The form code is as follows;

 

<form id="pointsForm" name="pointsForm" method="post" action="points-engine.php">

<select name="car" id="car">
	<?php
        // result of car name collection
        $result = mysql_query ($query);
        
        //Array stored in $cars
        while($cars=mysql_fetch_array($result)){
            
        //option values added by looping through array
        echo "<option value=$cars[id]>$cars[carName]</option>";
        }
	?>
</select>

<select name="season" id="season">
<option value="low">Low season</option>
<option value="mid">Mid season</option>
<option value="high">High season</option>
    <option value="peak">Peak season</option>
</select>
    
    <select name="period" id="period">
<option value="day">One day</option>
<option value="weekend">Weekend</option>
<option value="week">One week</option>
</select>

<input type="submit" name="Submit" value="Submit" />  

</form>

 

which posts to;

 

<?php

$car=$_POST['car'];
echo $car;

$season=$_POST['season']; 
echo $season;

$period=$_POST['period'];
echo $period;

?>

 

The initial form code is working fine, the car field is being populated from the database. My problem is the post value for car isn't working...

 

points-engine.php is echoing $season & $period fine but not $car

 

can anyone tell me why?

 

many thanks

Richard

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.