The following code works in Chrome. But in Firefox the submit step is not working
<?php
if(!isset($_POST['submit'])){
?>
<form action="" method="post">
<b>ID:</b>
<input name="std_no" type="text" />
<input type="image" width="100" value="submit" name="submit" id="submit" src="images/butup.gif" alt="submit Button">
</form>
<?php
}
else {
$id=$_POST['std_no'];
echo $id;
}
?>
The issue is that an image submit doesn’t send the name “submit” it sends “submit_x” and “submit_y”
So you should check for
EDIT: I’ve done a little more testing on this and it appears in Firefox (16) and IE(7, 8, 9) only the x and y get sent whereas in Chrome (23) and Safari (5.1) it also send the name too along with x and y.
So the safest way is to check for the value is :
isset($_POST['name_x'])