Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2014
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. $token = substr( md5( microtime() ), -12 );
  2.  
  3. $token = base64_encode ( $email ); // The users email will be encoded
  4.  
  5. $emailToken = base64_decode( $_GET['t'] ); // Contains the users email
  6.  
  7. if ( base64_encode( base64_decode( $_GET['t'] ) ) === $_GET['t'] ) {
  8. // Valid base64... we hope but is it a valid email?
  9. $emailToken = filter_var( base64_decode( $_GET['t'] ), FILTER_SANITIZE_EMAIL );
  10. if ( filter_var( $emailToken, FILTER_VALIDATE_EMAIL ) ) {
  11. // Email is valid. Do something to call email info
  12. }
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement