PHP/HTML image button

hellix

New Member
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:\[code\]<form method="post"><input type="image" src="http://stackoverflow.com/questions/3855412/delete.png" id="delete" name="delete" title="Delete Message" alt="Delete button" value="http://stackoverflow.com/questions/3855412/<? echo $row['MessageId'] ?> " ><input name="do_insert2" type="hidden" value="http://stackoverflow.com/questions/3855412/<? echo $row['MessageId'] ?> " > </form> \[/code\]Then I have a small script (just a test to see if it knew which messageid was clicked -which would later be deleted...\[code\]<?if ($_POST['do_insert2'] != NULL) {$deletemessage = $_POST['do_insert2'];echo $deletemessage;}?>\[/code\]However it would always come out with the last message (ID 269), no matter which image button you click.Why is this and how can I fix it?
 
Back
Top