Hey all, I hope I don't catch too much flame for asking this but I have been poking around the forums and can't seem to find a definite answer to this one...
I have a form that loads up the users name and email address and allows them to change it.
So I figured to update the JUser object all I had to do was put this code:
in the "On Submit code - before sending email" field but I guess I don't understand how that field is used..
Could anyone point out my mistake?
I have a form that loads up the users name and email address and allows them to change it.
So I figured to update the JUser object all I had to do was put this code:
<?php
$user = JFactory::getUser();
$user->name = JRequest::getVar('name');
$user->email = JRequest::getVar('email');
$user->save(true);
?>
in the "On Submit code - before sending email" field but I guess I don't understand how that field is used..
Could anyone point out my mistake?
Hi innovate.invent,
That code looks good to me. I woudl make one change to add =& here to make doubly sure that you are editing the User Object in use and not a copy of it.
Note that the OnSubmit Before Email box code is only executed if "Send Emails" is set to 'Yes' on the form General tab.
Bob
That code looks good to me. I woudl make one change to add =& here to make doubly sure that you are editing the User Object in use and not a copy of it.
$user =& JFactory::getUser();Note that the OnSubmit Before Email box code is only executed if "Send Emails" is set to 'Yes' on the form General tab.
Bob
Ah, I see. I do not wish to send an email for this form. Where should that code be placed otherwise?
This topic is locked and no more replies can be posted.
