The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.2.25 (Linux)
File Line Function
/global.php(961) : eval()'d code 26 errorHandler->error
/global.php 961 eval
/showthread.php 28 require_once





× This forum is read only. As of July 23, 2019, the UserSpice forums have been closed. To receive support, please join our Discord by clicking here. Thank you!

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Multiple Forms
#12
Here is the code I use in my header:

Code:
// CSRF check
Code:
if (!empty($_POST)) {
Code:
$tokenPost = Input::sanitize($_POST['csrf']);
Code:
if (!Token::check($tokenPost)) {
Code:
$userPermissions->addAudit($pathToCheck); // This line goes with my custom permissions class and adds a new line to the audit table for the tomfoolery page
Code:
Redirect::to('csrf.php'); // a custom 'try again without a page refresh' notification page
Code:
die();
Code:
}
Code:
}
Code:
$token = Token::generate();

From here I use echo $token into all my page forms.
  Reply


Messages In This Thread
Multiple Forms - by Brandin - 06-25-2017, 12:54 PM
Multiple Forms - by faguss - 07-14-2017, 10:26 PM
Multiple Forms - by firestorm - 07-15-2017, 06:56 AM
Multiple Forms - by firestorm - 07-15-2017, 06:57 AM
Multiple Forms - by firestorm - 07-15-2017, 11:20 AM
Multiple Forms - by karsen - 07-15-2017, 02:56 PM
Multiple Forms - by firestorm - 07-15-2017, 03:11 PM
Multiple Forms - by karsen - 07-15-2017, 04:33 PM
Multiple Forms - by firestorm - 07-15-2017, 04:45 PM
Multiple Forms - by karsen - 07-15-2017, 04:56 PM
Multiple Forms - by firestorm - 07-15-2017, 05:29 PM
Multiple Forms - by karsen - 07-15-2017, 06:03 PM
Multiple Forms - by firestorm - 07-15-2017, 07:17 PM
Multiple Forms - by bladerunner - 12-14-2017, 11:51 AM

Forum Jump:


Users browsing this thread: 2 Guest(s)