Wreckmaster
Posts: 48
|
Posted: 04/07/2014, 5:04 AM |
|
I have an image upload facility for logged in members, is it possible for me, with the upload form to grab the user_id from the session and store in data base (for each image uploaded).
|
|
|
saseow
Posts: 744
|
Posted: 04/07/2014, 6:05 AM |
|
Add a hidden field e.g. user_id to the upload form and in the default value for that field enter CCGetSession("UserID"). Obviously you will have the user_id field (integer) in the database as well.
|
|
|
Wreckmaster
Posts: 48
|
Posted: 04/08/2014, 3:36 AM |
|
Thank you saseow.
I should have said I had tried this already, when I add a new control to the file upload form the published page (live page) is blank . I code for the upload component is in the class file, I am assuming its in there I will need to make changes ?.
|
|
|
saseow
Posts: 744
|
Posted: 04/08/2014, 5:36 AM |
|
That is very strange. I would think that something else is very wrong.
I have several projects where I have added the file upload component to record forms that have many other input fields and hidden fields.
The only thing I can suggest is to redo the form from scratch. Something must be corrupted somewhere.
If nothing works you could add the user id to the record after the form has been submitted with the $last_id = mysql_insert_id() thingy.
Sorry I can not be of more help.
|
|
|
Wreckmaster
Posts: 48
|
Posted: 04/09/2014, 2:16 AM |
|
Thanks Saseow
This form belongs to an old project I am updating (about 3yrs) , I just noticed that I had used the upload form from Example Pack 2 , as it had features which suited what I was doing at the time.
But still can not add a hidden control on this form .
|
|
|
saseow
Posts: 744
|
Posted: 04/09/2014, 3:38 AM |
|
Strange. I guess your only bet is to add the ID into the record in the after insert event or redo the entire form from scratch. That is something I have had to do on several occassions.
|
|
|