Whenever I submit a feedback in my php page, it records the text in the database however when i refresh my page the data in the mysql database duplicates. What is wrong with my code?
<?php
include('session.php');
if(isset($_POST['submit'])){
$fidbak = mysqli_real_escape_string($db,$_POST['fidbak']);
$sql = "INSERT INTO tblfeedback VALUES ('$user_check',
'$FirstName $MiddleName $LastName', '$fidbak')";
$result = mysqli_query($db,$sql) or die(mysql_error());
}
?>
<!doctype>
<html>
<head>
<link rel="stylesheet" type="text/css" href="css/feedback.css">
<meta name="viewport" content="width=device-width, initial-scale=1">
<form action="" method="POST">
</head>
<body>
<div class="mainDiv">
<div class="mainFeedback">
<div class="fback">
<textarea rows="20" cols="65" placeholder="What can we do?" name="fidbak"></textarea>
<button id="subm" type="submit" name="submit">Submit</button><br><br>
</span>
</div>
</div>
</div>
<script src="sameFunctions.js"></script>
<script src="js/fback.js"></script>
</body>
</html>