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
redirect
#1
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
  Reply
#2
Redirect::to('whereyouwantthemtogo.php');
  Reply
#3
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



?>
  Reply
#4
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’);
}
  Reply
#5
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?
  Reply
#6
Thank you - managed to get it working.

Thanks again
  Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)