06-21-2018, 05:25 PM
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...
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
or and that will always give you that information of the logged in user.
So on submit, you would just do
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
Code:
$user->data()->email
So on submit, you would just do
Code:
if(!empty($_POST){
Code:
$username = $user->data()->username;
Code:
}