I have the following scenario -
User clicks on an image to search for a particular brand vehicle. The value of that image must then go the hidden box where I will post the value returned to another form. I just can't seem to get the value returned...
My code...
<form action="searchbrand.php" method="POST" name="frmbrand">
<!--First row of logos...-->
<table class="whitelogo">
<tr>
<td align="center">
<p style="height:5px"></p>
<input type="image" name="brand" id="brand" value="Alfa Romeo" src="images/carlogos/alfa.jpg" height="55px" width="55px" title="View our Alfa Romeo Selection" alt="Alfa Romeo" onClick="javascript:document.submitForm.submit();" />
</td>
<td align="center">
<p style="height:5px"></p>
<input type="image" name="brand" id="brand" value="Aston Martin" src="images/carlogos/aston.jpg" height="55px" width="55px" title="View our Aston Martin Selection" alt="Aston Martin" onClick="javascript:document.submitForm.submit();" />
</td>
<td align="center">
<p style="height:5px"></p>
<input type="image" name="brand" id="brand" value="Audi" src="images/carlogos/audi.gif" height="55px" width="55px" title="View our Audi Selection" alt="Audi" onClick="javascript:document.submitForm.submit();" />
</td>
<td align="center">
<p style="height:5px"></p>
<input type="image" name="brand" id="brand" value="Bentley" src="images/carlogos/bentley.jpg" height="55px" width="55px" title="View our Bentley Selection" alt="Bentley" onClick="javascript:document.submitForm.submit();" />
</td>
<td align="center">
<p style="height:5px"></p>
<input type="image" name="brand" id="brand" value="BMW" src="images/carlogos/bmw.gif" height="55px" width="55px" title="View our BMW Selection" alt="BMW" onClick="javascript:document.submitForm.submit();" />
</td>
<td align="center">
<p style="height:5px"></p>
<input type="image" name="brand" id="brand" value="Cadillac" src="images/carlogos/cadillac.jpg" height="55px" width="55px" title="View our Cadillac Selection" alt="Cadillac" onClick="javascript:document.submitForm.submit();" />
</td>
</tr>
</table>
As you will notice here I have named the images ALL 'brand' with seperate values for each.
<input type="hidden" name="hidbrand" value="<?=$_POST['brand'];?>"/>
</form>
I'm trying to capture the value here from whichever image user clicked on...
In my searchbrand.php page, which will then do stuff according to the returned value, the following...
<?php
include 'init.php';
$vehicle_brand = $_POST['hidbrand'];
echo $vehicle_brand, '</br>';
?>
Nothing gets returned, no error, no value, all blank like me :)
Anyone have an idea where I'm going haywire?