The following warnings occurred: | ||||||||||||
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.2.25 (Linux)
|
redirect - Printable Version +- UserSpice (https://userspice.com/forums) +-- Forum: Support Center (https://userspice.com/forums/forumdisplay.php?fid=23) +--- Forum: UserSpice 4.3 and Below (https://userspice.com/forums/forumdisplay.php?fid=26) +--- Thread: redirect (/showthread.php?tid=823) |
redirect - matt - 11-08-2017 How would you redirect certain users to page on login? I know there is a custom login script but not sure what to add?? Regards Matt redirect - Brandin - 11-08-2017 Redirect::to('whereyouwantthemtogo.php'); redirect - matt - 11-10-2017 I have tried the below code but still gives an error? <?php //Whatever you put here will happen after the username and password are verified and the user is "technically" logged in, but they have not yet been redirected to their starting page. This gives you access to all the user's data through $user->data() if (checkMenu(4,$user->data()->id)){ Redirect::to($us_url_root.'users/account2.php'); else { Redirect::to($us_url_root.'users/account.php'); } } //Where do you want to redirect the user after login ?> redirect - Brandin - 11-10-2017 What error is it giving you? One thing I can see is that you have your else within your checkmenu, so there is no "else". You should have: if (checkMenu(4,$user->data()->id)){ Redirect::to($us_url_root.’users/account2.php’); } else { Redirect::to($us_url_root.’users/account.php’); } redirect - matt - 11-10-2017 Parse error: syntax error, unexpected 'else' (T_ELSE) in /home/firstti7/public_html/insightfulsearch.co.uk/con/usersc/scripts/custom_login_script.php on line 6 Bascially I would like users who have permission 4 to direct to another page? redirect - matt - 11-10-2017 Thank you - managed to get it working. Thanks again |