document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. <?php
  2.   session_start();
  3.  
  4.   if (isset($_POST[\'uname\'], $_POST[\'token\'])) {
  5.     if (!empty($_POST[\'uname\']) && !empty($_POST[\'token\'])) {
  6.       if (!Security::checkToken($_POST[\'uname\'])) {
  7.         // Show the error or redirect on home page!
  8.         header(\'Location: index.php\');
  9.         die();
  10.       }
  11.  
  12.       // Succeed!
  13.       print_r($_POST);
  14.     }
  15.   }
  16. ?>
  17. <html>
  18.   <head>
  19.     <title>CSRF - TheCodePress</title>
  20.   </head>
  21.   <body>
  22.     <form action="index.php" method="POST">
  23.       <label>Email:</label><br />
  24.       <input type="text" name="uname" placeholder="Username" />
  25.       <input type="hidden" name="token" value="<?php echo Security::getToken(); ?>" />
  26.     </form>
  27. </body>
  28. </html>
');