CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 Image Upload + User-id

Print topic Send  topic

Author Message
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).
View profile  Send private message
saseow

Posts: 735
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.
View profile  Send private message
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 ?.
View profile  Send private message
saseow

Posts: 735
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.
View profile  Send private message
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 .
View profile  Send private message
saseow

Posts: 735
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.
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright 2003-2004 by UltraApps.com  and YesSoftware, Inc.