Dear All,
Is there any way to include joomla (who has login) users' information in the form and output email.
for example:
User admin login and access the form, input everything and submit.
I want the name of admin and his email are included in the output email.
Thanks!
Is there any way to include joomla (who has login) users' information in the form and output email.
for example:
User admin login and access the form, input everything and submit.
I want the name of admin and his email are included in the output email.
Thanks!
Hi,
You can get the logged in user name through this code :
put it in the email template field or a hidden one in the html.
Cheers
Max
You can get the logged in user name through this code :
<?php
global $my;
echo $my->username;
?>
put it in the email template field or a hidden one in the html.
Cheers
Max
I've tried the above, and I get nothing.
That is, the username is not printed out or put into a field.
On the other hand, it doesn't cause my page to break.
That is, the username is not printed out or put into a field.
On the other hand, it doesn't cause my page to break.
Hi lawrax,
What exactly do you want to do? This code should show the user name in Joomla 1.0.x (might be different in 1.5 I'd need to check). Have you put this into an email template? or your html code?
Bob
What exactly do you want to do? This code should show the user name in Joomla 1.0.x (might be different in 1.5 I'd need to check). Have you put this into an email template? or your html code?
Bob
Hi Lawrax,
for joomla 1.5 the code is :
Max<br><br>Post edited by: GreyHead, at: 2007/11/18 07:56
for joomla 1.5 the code is :
<?php
$user = &JFactory::getUser();
echo $user->username;
?>
Cheers
Max<br><br>Post edited by: GreyHead, at: 2007/11/18 07:56
Here is a form I made so my users can submit news. It will show the user name in the form and will e-mail the user name to me so I know who sent it.
Hope it helps.
<br><br>Post edited by: GreyHead, at: 2007/11/27 19:52
Hope it helps.
<?php global $my; ?>
<div align="center"><h2 style="color: #cc3300;">Submit News </h2></div>
<hr>
<input type="hidden" name="username" value="<?php echo $my->username; ?>" />
Thank you for taking the time to submit your news <?php echo $my->username; ?>
<p>Would you like us to contact you for more info? <input type="radio" name="contact" value="
YES_contact" id="ff_elem183"> <label id="ff_lbl183" for="ff_elem183">Yes </label>
<input type="radio" name="contact" value="no_contact" id="ff_elem184"> <label id="ff_lbl184" for="
ff_elem184">No </label></p>
<hr>
<div align="Center"><strong>News Details</strong></div>
<blockquote>
<p>Title:</p>
<p><textarea cols="30" name="Title" id="ff_elem205" style="height:63px; width:500px;" rows="4"></textarea></p>
<hr>
<p>Description:</p>
<p><textarea cols="60" name="Description" id="ff_elem206" style="height:63px; width:500px;" rows="5"></textarea></p>
<p><input type="submit" value="Submit News" name="Submit" style="font-style:italic; font-weight: bold;">
<input type="reset" value="Reset (cancel form)" name="reset" style="font-size:8pt; font-style:oblique;"></p>
<hr>
Edited to add code tags, image & correct a few typos

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