Sending image value to second form in php
<p>I have the following scenario -</p>

<p>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...</p>

<p>My code...</p>

<pre><code>&lt;form action="searchbrand.php" method="POST" name="frmbrand"&gt;
 &lt;!--First row of logos...--&gt;   
 &lt;table class="whitelogo"&gt;
  &lt;tr&gt;
    &lt;td align="center"&gt;
        &lt;p style="height:5px"&gt;&lt;/p&gt;
        &lt;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();" /&gt;
    &lt;/td&gt;
    &lt;td align="center"&gt;
        &lt;p style="height:5px"&gt;&lt;/p&gt;
        &lt;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();" /&gt;
    &lt;/td&gt;
    &lt;td align="center"&gt;
        &lt;p style="height:5px"&gt;&lt;/p&gt;
        &lt;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();" /&gt;
    &lt;/td&gt;
    &lt;td align="center"&gt;
        &lt;p style="height:5px"&gt;&lt;/p&gt;
        &lt;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();" /&gt;
    &lt;/td&gt;
    &lt;td align="center"&gt;
        &lt;p style="height:5px"&gt;&lt;/p&gt;
        &lt;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();" /&gt;
    &lt;/td&gt;
    &lt;td align="center"&gt;
        &lt;p style="height:5px"&gt;&lt;/p&gt;
        &lt;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();" /&gt;
    &lt;/td&gt;
 &lt;/tr&gt;
&lt;/table&gt;
</code></pre>

<p>As you will notice here I have named the images ALL 'brand' with seperate values for each.</p>

<pre><code> &lt;input type="hidden" name="hidbrand" value="&lt;?=$_POST['brand'];?&gt;"/&gt;
 &lt;/form&gt;
</code></pre>

<p>I'm trying to capture the value here from whichever image user clicked on...</p>

<p>In my searchbrand.php page, which will then do stuff according to the returned value, the following...</p>

<pre><code> &lt;?php
 include 'init.php';
 $vehicle_brand = $_POST['hidbrand'];
 echo $vehicle_brand, '&lt;/br&gt;';
 ?&gt;
</code></pre>

<p>Nothing gets returned, no error, no value, all blank like me :)
Anyone have an idea where I'm going haywire?</p>
