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
https://forums.phpfreaks.com/topic/227098-form-using-php-is-not-posting-value/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.