stop inserting data in the database when refreshing the page

后端 未结 10 1272
太阳男子
太阳男子 2020-12-06 02:27

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

<         


        
10条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-06 02:56

    confirm_page.php:

    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')"); // <-- missing endquote and bracket here
    
    header('Location: somewhere_else.php');
    exit;
    }
    

提交回复
热议问题