When I insert data and I refresh page It will auto insert old data
I try use header location :
if (!empty($msg_success)) {
echo '<script type="text/javascript">alert("' . $msg_success . '")</script>';
header('location:'.$_SERVER['REQUEST_URI']);
exit();
}
It's work but It didnt echo alert! before refresh page
How can I echo alert before reload page ? or Is there anyway to prevent insert data when refresh page ?
UPDATE
when I refresh page I've $_POST['submit']
that why my data keep insert when I refresh