Below is my php
code that caries out the redirection
Code Snippet :-
echo "<form action='exp_yogesh.php?id=$id' method='post'>";
echo "<td> <input type='image' name='putonline' value='$id' src='images/on_button.png' no-repeat; border:none;' alt='submit'> </td> ";
echo "<td> <input type='image' name='putoffline' value='$id' src='images/off_botton.png' no-repeat; border:none;' alt='submit'> </td> ";
echo "</form>";
Here's the exp_yogesh.php
file
<?php
include 'includes/connection.php';
session_start();
$new_id= $_GET['id'];
if (isset($_POST['putonline'])) {
$query = "UPDATE user SET status= '1' WHERE id= '$new_id'";
$result = $cid-> query($query);
if ($result== TRUE) {
header("Refresh:0.01; url=EidtEmp.php");
exit;
} else {
echo "";
}
}
if (isset($_POST['putoffline'])) {
$query = "UPDATE user SET status= '0' WHERE id= '$new_id'";
$result = $cid-> query($query);
if ($result== TRUE) {
header("Refresh:0.01; url=EidtEmp.php");
exit;
} else {
echo "not done";
}
}
mysqli_close($cid);
?>
The above code works properly when I run it on Google Chrome but doesn't when I do the same on Firefox
Try this; it might work.