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
/printthread.php 16 require_once



UserSpice
Not Logged in Redirect - Printable Version

+- UserSpice (https://userspice.com/forums)
+-- Forum: Miscellaneous (https://userspice.com/forums/forumdisplay.php?fid=28)
+--- Forum: Off-topic Discussions (https://userspice.com/forums/forumdisplay.php?fid=10)
+--- Thread: Not Logged in Redirect (/showthread.php?tid=636)



Not Logged in Redirect - truemama - 07-10-2017

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


Not Logged in Redirect - karsen - 07-11-2017

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;