Saving User ID with form data

Post any questions you may have here

Saving User ID with form data

Postby kokuryu on Thu May 08, 2008 6:51 pm

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?
kokuryu
Fresh Boarder
 
Posts: 2
Joined: Thu May 08, 2008 6:33 pm

Re:Saving User ID with form data

Postby GreyHead on Fri May 09, 2008 7:24 pm

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
Bob Janes
info at greyhead.net
ChronoForms Support If you like ChronoForms please vote or post a review at Joomla.org
User avatar
GreyHead
Platinum Boarder
 
Posts: 3251
Joined: Tue May 29, 2007 10:15 pm
Location: Brittany

Re:Saving User ID with form data

Postby kokuryu on Fri May 09, 2008 10:21 pm

Thanks a bunch! That worked great!

I tried to post the code I used, but it came out all gabaged and half missing...
kokuryu
Fresh Boarder
 
Posts: 2
Joined: Thu May 08, 2008 6:33 pm

Re:Saving User ID with form data

Postby GreyHead on Sat May 10, 2008 7:03 am

Hi kokuryu,

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

Bob
Bob Janes
info at greyhead.net
ChronoForms Support If you like ChronoForms please vote or post a review at Joomla.org
User avatar
GreyHead
Platinum Boarder
 
Posts: 3251
Joined: Tue May 29, 2007 10:15 pm
Location: Brittany


Return to Questions & Answers

Who is online

Users browsing this forum: Google [Bot], Yahoo [Bot] and 6 guests