stop inserting data in the database when refreshing the page.


The best way to prevent that is to add header('Location: filename') after your query. Thus in your case,
if (isset($_POST['submit'])) 
{
$user= $_POST['username'];
$email = $_POST['useremail'];
$pass= $_POST['password']; 

mysql_query("INSERT INTO table (username, useremail, email) VALUES ('$username','$useremail','$email');
//must be inside the condition to prevent too many redirects
header('Location: user_details_page.php');
}

Comments

Popular posts from this blog

How can I debug PHP cURL sessions?

[PHP] Create MySQL Trigger in PHP

Free icons