Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- echo "<input name='rft' type='hidden' value='".random_form_token()."' />";
- if(random_form_token($_POST['rft'])){
- //
- }
- else{
- //
- }
- function random_form_token($value=NULL){
- if($value == NULL){
- $token = hash("sha256","tanzmal".microtime());
- $_SESSION['random_form_token'] = $token;
- return $token;
- }
- else{
- if($value == $_SESSION['random_form_token']){
- unset($_SESSION['random_form_token']);
- return true;
- }
- else
- return false;
- }
- }
Add Comment
Please, Sign In to add comment