Forums

Saving User ID with form data

kokuryu 08 May, 2008
How do I save the User ID along with the form's data? I thought the "uid" field was that, but apparently that is some kind of unique hash created with each entry. Is there something special I need to include in the form or some setting I need to toggle to say that the form's data must be saved with the user id? Or do I need to put in a block of PHP code into the form and then echo out a hidden field to store it in?
GreyHead 09 May, 2008
Hi kokuryu,

In Joomla 1.0.x you can use the $my object to get user data. You'd need to put code something like this:

<?php
global $my;
<input type="hidden" value="<?php echo $my->id; ?>: />
?>

Joomla 1.5 code is slightly different and I can't remember it right now.

Bob
kokuryu 09 May, 2008
Thanks a bunch! That worked great!

I tried to post the code I used, but it came out all gabaged and half missing...
GreyHead 10 May, 2008
Hi kokuryu,

Yes, sorry the forum code display is broken for the moment . . . still searching for a fix.

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

VPS & Email Hosting 20% discount
hostinger