When I submit the form ,I want to display a jquery dialog(not alert) showing success message for a specific time and then it should redirect to a new page after that time is over.Please don't mark this question as duplicate,I know this question has been answered before but none of them gives me the desired result. Here is my html code-
<form action="submit.php" method="POST">
Name:<input type="name" id="name" />
Age:<input type="age" id="age" />
<input type="submit" name="save" />
</form>
Here is my submit.php code-
<?php
include('db.php');
$sql ="INSERT INTO details(`name`) VALUES ('".$_POST["name"]."','".$_POST["age"]."')";
if ($conn->query($sql) === TRUE) {
/*here i want to display the dialog and then redirect to new page i.e.-header('Location:enter.php')*/
header('Location:enter.php');
} else {
echo "Error: " . $sql . "<br>" . $conn->error;
}
$conn->close();
?>
I have tried onsubmit=popup();
,but this does not gives me confirmation that the form has been submitted.
function popup(){
$("#mess").dialog({});
setTimeout(wait, 3000);
}
Thanks in advance.