post - How to remove $_POST in php -
i writing php page, player voting. using $post method. when cast vote
if(isset($_post['amla'])){ $amla = "update players set amla=amla+1"; $run_amla =mysqli_query($conn , $amla); $_post = array(); echo "<script>alert('your vote casted'); </script>"; }
so when use print_r statement after check value of $_post ooutput : array();
but when refresh page $_post variable appear previous value rather empty array causes logical error cast vote automatically. how can clear $_post still clear after page refreshed.
replace
$_post = array();
with
unset($_post);
now post statement should empty.
Comments
Post a Comment