0
I have a PHP page with product search form. As soon as the user does the search I update the products of the page where the user enters the product detailing on another page. The page is responsive, so the user uses the application on the mobile. And a basic function for those who want to open the previous page is to click the "back" button of the device itself. Or even in the desktop browser. The problem when the user uses the back. It always falls on the form resubmission page, where the layman thinks it is an error.
Do you have any technique for not falling for this message?
My form filter looks like this:
if(isset($_POST['referencia'])&&$_POST['referencia']!=""){
$_SESSION['referencia_c']=$_POST['referencia'];
}
if(isset($_SESSION['referencia_c'])){
$filtro .= " AND LOWER(p.descricao) LIKE LOWER('%".$_SESSION['referencia_c']."%') ";
}
One technique I would use to avoid this disorder was to use Ajax. Have you thought about doing this?
– Taffarel Xavier
But even if I do it in ajax, after I enter another page and return to the search page, this error does not happen?
– Bruno
If you do it the right way, using Ajax, it doesn’t happen.
– Taffarel Xavier
As usually this error happens when submitting a form, edit your question and put your html form.
– Taffarel Xavier
I will edit and put the form, but when I return the page I am not sending any form. It turns out that when I go back to the page by entering the product search page that has the form.
– Bruno