I am working on a multiple page form which is hosted on IIS. The whole form is on one PHP file where each form page is a separate div set to display:none. When user clicks the next button, JS adds a class to current div to hide it and show the next one. On submit, a "Thank you" page is displayed. This page is located in the includes folder within the project folder.
This is the code that displays that page:
$stmt = sqlsrv_query( $conn, $tsql_callSP, $params);
if( $stmt === false )
{
echo "Error in executing statement.\n";
die( print_r( sqlsrv_errors(), true));
} else {
sqlsrv_free_stmt( $stmt);
sqlsrv_close( $conn);
header("location: success.php");
exit();
}
It works OK but users can click the back button in the browser and resubmit if they want to. How can I prevent this from happening? I've seen on CognitoForms that the back button is disabled (or there isn't anything to go back to) after form submission.
Any tips would be much appreciated.
Thanks, Tom.