Pass logged in users info to form fields
2 posts by 2 authors in: Forums > CMS Builder: Plugins & Add-ons
Last Post: October 26, 2010 (RSS)
Hi,
I am currently using cms Builder with the membership plugin installed and everything is working well. I have a login protected area that has a form in it and I would like to pre-populate some of the form fields with the current logged in users info ex. name, apartment number, phone number and email. I'm not to sure where to start.
I am using Machform to create the forms and do know that I have to pass the variables through the browser's address bar or something but I'm not quite sure. I'm not an idiot at this, I'm just a little unfamiliar. Any help would be great. Thanks.
I am currently using cms Builder with the membership plugin installed and everything is working well. I have a login protected area that has a form in it and I would like to pre-populate some of the form fields with the current logged in users info ex. name, apartment number, phone number and email. I'm not to sure where to start.
I am using Machform to create the forms and do know that I have to pass the variables through the browser's address bar or something but I'm not quite sure. I'm not an idiot at this, I'm just a little unfamiliar. Any help would be great. Thanks.
Re: [Dan Maitland] Pass logged in users info to form fields
By Jason - October 26, 2010
Hi Dan,
If you're wanting to access variables associated with a user (ie, in the User Accounts section), you don't have to pass values in the address bar. You can access all the fields in the user accounts section by using the $CURRENT_USER variable.
So, for example, if you have a text field that you want to display the user's email in it, the code would look like this:
Hope this helps.
If you're wanting to access variables associated with a user (ie, in the User Accounts section), you don't have to pass values in the address bar. You can access all the fields in the user accounts section by using the $CURRENT_USER variable.
So, for example, if you have a text field that you want to display the user's email in it, the code would look like this:
<input type="text" name="email" value="<?php echo @$CURRENT_USER['email'];?>" />
Hope this helps.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com
Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/
Jason Sauchuk - Project Manager
interactivetools.com
Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/