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
Not Logged in Redirect
#1
Hi all - really liking userspice guys, great work. Need a bit of help...

I'm taking the user from a Public to a Private webpage and userspice redirects the user to the login page. It looks like there is a great feature wherby userspice retains where the user was going and then redirects the user once they have completed the login page it takes them to where they were going originally....great but... I'm losing a variable so if my link pre login was:

/usersc/mypage.php?id=5

it redirects to just

usersc/login.php?&dest=usersc/mypage.php

but loses the ?id=5 which is the variable I want to hold onto..

any ideas?

Cheers,

Matt
  Reply
#2
The easiest thing to do without modifying the Redirect class is to simply store the ID in a session variable. I'd use two, one for the current page and one for the previous page. Be sure to update the previous ID before the new current ID:

Code:
$_SESSION['previous_page_id'] = $_SESSION['current_page_id'];
Code:
$_SESSION['current_page_id'] = $current_page_id;
  Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)