I am looking for a way to stop inserting or sending data in the database when refreshing the page.
here is my code:
user_details_page.php
<
What is going on here is that when you refresh page, the form is submitted twice.
To prevent this, you can use sessions:
session_start();
if( $_SESSION['submit'] == $_POST['submit'] &&
isset($_SESSION['submit'])){
// user double submitted
}
else {
// user submitted once
$_SESSION['submit'] = $_POST['submit'];
}