I am trying to prevent a form being submitted again after page refresh. I looked at some example answers from SO, but it doesn't seem to work. Mainly they mention redirection but when I use this, it takes me to a blank page even if I am trying to redirect to the same page.
Does anybody have an idea on how to fix this? Below is code and near the end is the location code for redirection.
// Processing form data when form is submitted
if($_SERVER["REQUEST_METHOD"] == "POST"){
if ($_POST["Login"]){
...
$sql = "UPDATE itstusers SET password = ? WHERE username = ?";
if($stmt = mysqli_prepare($link, $sql)){
mysqli_stmt_bind_param($stmt, "ss", $new_password_hash, $reset_param_username);
mysqli_stmt_execute($stmt);
mysqli_stmt_close($stmt);
}
header("location: ./");
exit;
}