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
custom login page
#4
Ok, so I think you're thinking about that wrong. Once someone is logged in, you have the entire user object at your disposal. In fact, try this...

Go on a page where the user is logged in. Any page and add this code...

Code:
<?php
Code:
if(isset($user) && $user->isLoggedIn()){
Code:
dump($user);
Code:
}
Code:
?>

You don't need that isset part, but what it does is stops the page from throwing a bunch of errors if the user isn't logged in.

So, once you have all that information, you can just call it by doing
Code:
$user->data()->fname
or
Code:
$user->data()->email
and that will always give you that information of the logged in user.

So on submit, you would just do
Code:
if(!empty($_POST){
Code:
$username = $user->data()->username;
Code:
}
  Reply


Messages In This Thread
custom login page - by roger - 06-21-2018, 12:39 PM
custom login page - by mudmin - 06-21-2018, 02:33 PM
custom login page - by roger - 06-21-2018, 04:06 PM
custom login page - by mudmin - 06-21-2018, 05:25 PM
custom login page - by roger - 06-22-2018, 09:06 AM
custom login page - by roger - 06-22-2018, 09:23 AM
custom login page - by mudmin - 06-22-2018, 11:23 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)