Forums

retrieve user information

t3living 04 Mar, 2016
I am having intermittent issues trying to save user information with a form

I have
   On load
--HTML (Render Form)

On submit
--custom code
<?php
$user = \JFactory::getUser();
$form->data['user_name'] = $user->name;
$form->data['user_id'] = $user->id;
?>

--DB Save

--Debugger
Array
(
    [option] => com_chronoforms5
    [chronoform] => CoachingSessionRating
    [event] => submit
    [coachee] => 1
    [coachsessiondate] => 03/04/2016
    [relateradio2] => 3
    [structureradio2] => 4
    [button4] => Submit
    [user_name] => 
    [user_id] => 0
    [id] => 7
)
t3living 04 Mar, 2016
i have read those and followed them
GreyHead 04 Mar, 2016
Hi steve,

This looks to be what I would expect if the user is not logged in.

Bob
This topic is locked and no more replies can be posted.