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
Status Update 022
#10
Generally anytime I load another page with a form one of the two will fail because of the token being generated on every form load…are you suggesting I generate the token elsewhere? Wouldn’t I still have this issue though?

The token system doesn't technically care where the token is generated, but you do have to make sure it's after post.

So, if your page is
headers/includes
$_POST
Form1
Form2

You can do
headers/includes
$_POST
$token = Token::generate
form1 (with $token in a hidden field)
form2 (with $token in a hidden field)

The big thing people do when they try to generate the token outside the form is that they put it before $_POST so the token changes JUST BEFORE $_POST is read.

Since php reads the file in order, you submit the page, it reads the headers, processes post (including the token) and then generates a new token without breaking the old $_POST.
  Reply


Messages In This Thread
Status Update 022 - by mudmin - 09-23-2017, 08:46 PM
Status Update 022 - by Brandin - 09-23-2017, 09:01 PM
Status Update 022 - by mudmin - 09-23-2017, 09:16 PM
Status Update 022 - by Brandin - 09-23-2017, 09:31 PM
Status Update 022 - by Brandin - 09-23-2017, 09:33 PM
Status Update 022 - by mudmin - 09-23-2017, 09:38 PM
Status Update 022 - by Brandin - 09-23-2017, 09:43 PM
Status Update 022 - by mudmin - 09-23-2017, 09:48 PM
Status Update 022 - by Brandin - 09-23-2017, 09:52 PM
Status Update 022 - by mudmin - 09-23-2017, 09:52 PM
Status Update 022 - by mudmin - 09-23-2017, 10:19 PM
Status Update 022 - by mudmin - 09-23-2017, 10:55 PM
Status Update 022 - by Brandin - 09-23-2017, 11:38 PM
Status Update 022 - by mudmin - 09-24-2017, 12:48 PM

Forum Jump:


Users browsing this thread: 2 Guest(s)