The following code works in Chrome. But in Firefox the submit step is not working
<?php
if(!isset($_POST['submit'])){
$id=$_POST['std_no']; // put it here so whenever you click submit button
echo $id; // $_POST is trigger
?>
<form action="/**input 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>
you should input in action=""; // the php page of your code or the page where you want to get the data sample page.php
or try this
<?php echo htmlentities($_SERVER['PHP_SELF']); ?> // put in action
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
if (isset($_POST['submit_x']))...
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'])