The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.1.2-1ubuntu2.14 (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
#13
argh ok, well I've created a new CSRF Protect class with session storage, i can confirm with 4 forms on a page no more "token not valid" issues, same token per session.

we drop it into classes, will need requiring from init if autoload not present.

we instantiate with:

Code:
$csrf = new CSRF_Protect();

we automatically insert hidden form field using this in the form:

Code:
<?php $csrf->echoInputField();?>

then we check its valid in our php, so after
Code:
if(!empty($_POST['copyright1'])){
we would do:

Code:
$csrf->verifyRequest();

hope thats helps some, find the class here: https://github.com/Firestorm-Graphics/CSRF-Protect
  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: 1 Guest(s)