I'm creating a control page for my site, but when the page is reloaded I always get an alert asking if I'd like to resend used parameters. I would like to know how to remove this alert or send your confirmation automatically.
I'm creating a control page for my site, but when the page is reloaded I always get an alert asking if I'd like to resend used parameters. I would like to know how to remove this alert or send your confirmation automatically.
If I understand what is happening is that you used a form with the method post and for the page in which it was sent try to reload it, if what I understood is correct, this is a browser action because in HTTP headers it will send to the server is a header with method post and it reconfirms the sending of the same data used previously.
Well, I do not know how you are performing this reloading, but if it is automatic by the system, send via get passing url, I had this problem with the user giving F5 to reload the page, to solve validated if the post is equal to previous it returns the page via url:
if($_SERVER['REQUEST_METHOD'] == 'POST') {
$request = implode($_POST);
if(isset($_SESSION['last_request']) && ($_SESSION['last_request'] == $request)) {
header("Location:".$url);
exit;
}else {
$_SESSION['last_request'] = $request;
}
}