Search in support tickets

#863 – email of user not in contactform

Posted in ‘Support’
This is a public ticket. Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.
Saturday, 28 November 2020 07:03 CET
LenaJL
I thought in the message view default.php

<input class='adsmanager_required' id='email' type='text' name='email' maxlength='50' value='<?php echo @$this->user->email; ?>' />

would call the user's emailadress and put it into that iput field. Is this correct? As it is not working for my website.


Thx for clarification.
Lena
Custom Fields
Joomla Version
3.9.22
PHP Version
7.3
Product
AdsManager
Product Version
latest
Monday, 30 November 2020 14:30 CET
loic
Hello,

To know what informations are available in the user variable, you can display a dump of that variable like this :
<?php var_dump($this->user); ?>


The result of that line will give you all the datas contained by the user objet.

Best regards.
 
Monday, 30 November 2020 19:16 CET
LenaJL
Hi,

thank you. Tried out your suggestion and it is NULL then. Any idea why it's working on your demo but not on my website?

Thx,
Lena
Tuesday, 01 December 2020 14:32 CET
loic
Hello,

Try to add that line in the php at the beginning of the file :

$user = JFactory::getUser();


It will load the current logged in user, then you will be able to check the content of that object with :
var_dump($user);


And at last, you will be able to call the correct property :
$user->email;


Best regards.
 
This ticket is closed, therefore read-only. You can no longer reply to it. If you need to provide more information, please open a new ticket and mention this ticket's number.