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

Popular posts from this blog

java - Jasper subreport showing only one entry from the JSON data source when embedded in the Title band -

serialization - Convert Any type in scala to Array[Byte] and back -

SonarQube Plugin for Jenkins does not find SonarQube Scanner executable -