What is the potential issue with PHP form submission causing duplicate entries in the database upon page refresh?

When a user submits a form in PHP and then refreshes the page, the form data is resubmitted, potentially causing duplicate entries in the database. One way to solve this issue is to use a technique called Post/Redirect/Get (PRG) pattern. After form submission, redirect the user to a different page using the header() function to prevent the form data from being resubmitted upon page refresh.

if ($_SERVER["REQUEST_METHOD"] == "POST") {
    // Process form data
    
    // Redirect to a different page after processing the form data
    header("Location: success.php");
    exit();
}