Virajsinh

verify User using mail token

May 29th, 2020
46
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $random_hash = md5(openssl_random_pseudo_bytes(32));
  2. $random_hash = md5(mcrypt_create_iv(32, MCRYPT_DEV_URANDOM));
  3.  
  4. // New in PHP7
  5. $random_hash = bin2hex(random_bytes(32));
  6.  
  7. db("INSERT INTO confirmtoken ...", $confirm_token, time()+24*3600);
  8. db("SELECT * FROM confirmtokens WHERE id=? AND maxtime<UNIX_TIMESTAMP()");
RAW Paste Data