Data is inserted automatically

shanehedgehog

New Member
In this code everything is working fine it take user name from session and insert data perfectly via radio button, only problem is it automatically insert data again when I reload the page.\[code\]if(isset($_SESSION['user_id'])&&isset($_POST['r1'])&&isset($_POST['r2'])&&isset($_POST['r3'])&&isset($_POST['r4'])&&isset($_POST['suggestion'])&&isset($_POST['submit'])){ $user=$_SESSION['user_id']; $r1=$_POST['r1']; $r2=$_POST['r2']; $r3=$_POST['r3']; $r4=$_POST['r4']; $suggestion=$_POST['suggestion']; $query_insert="INSERT INTO `wp_feedback` VALUES ('".$user."','".$r1."','".$r2."','".$r3."','".$r4."','".$suggestion."')"; if($query_run=mysql_query($query_insert)){ echo "alright"; } else { echo "not inserted"; }}\[/code\]Thanks in advance.
 
Back
Top