Pass logged in users info to form fields

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:

<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/