I have a simple form that submits text to my SQL table. The problem is that after the user submits the text, they can refresh the page and the data gets submitted again with
Use header and redirect the page.
header("Location:your_page.php"); You can redirect to same page or different page.
header("Location:your_page.php");
Unset $_POST after inserting it to Database.
unset($_POST);