title: PHP/HTML image button
body: <p>I have some image buttons (echo'd in a loop -based on mysql results, -not included in code below)
  -its abit like a delete button for a message system:</p>
  
  <pre><code>&lt;form method="post"&gt;
  &lt;input type="image" src="delete.png" id="delete" name="delete" title="Delete Message" alt="Delete button" value="&lt;? echo $row['MessageId'] ?&gt; " &gt;
  &lt;input name="do_insert2" type="hidden" value="&lt;? echo $row['MessageId'] ?&gt; " &gt;    
  &lt;/form&gt; 
  </code></pre>
  
  <p>Then I have a small script (just a test to see if it knew which messageid was clicked -which would later be deleted...</p>
  
  <pre><code>&lt;?
  if ($_POST['do_insert2'] != NULL) {
  $deletemessage = $_POST['do_insert2'];
  echo $deletemessage;
  }
  ?&gt;
  </code></pre>
  
  <p>However it would always come out with the last message (ID 269), no matter which image button you click.</p>
  
  <p>Why is this and how can I fix it?</p>