Jump to content

Approve/Deny form


leeandrew

Recommended Posts

I have a form working on my site which allows users to upload jpg/gif photos to a folder on my site. I have coded it to rename the file prefixed with the users username upon uploading, i.e. leeandrew_img009.JPG. This is so i know which user has uploaded what.

 

I am the admin on my site and want to create an approve/deny photos section in the backend to save all the time i spent manually entering details for users in the DB (users get rewarded for uploads, so i have to add points to a column).

 

I want upon successful execution of upload for the admin (me) to be notified in the backend. Then i can select approve/deny for that photo.

 

and use SQL insert for adding points.

 

Something like:

 

If 'approved' add '1' to 'photo_points'. Then relocate the image to another folder.

 

If 'deny' delete the image from the temp folder.

 

Can anyone help?

Link to comment
https://forums.phpfreaks.com/topic/97657-approvedeny-form/
Share on other sites

1. Create a field on your current form and in the data table called status... on user upload set it to pending or something like that (I would use P=pending, A=approved, D=denied).

 

2. then build an admin page for yourself that will query the db for all pics with a status of "P"

 

3. Set check boxes or radio buttons for Approve/Deny on each pic returned

 

4. loop through the data submitted by your admin page and update the status variable to the value of the selected checkbox.

 

5. Then you could periodically run a script that would query for and delete all records of images that have been denied

 

Hope that helps

 

Link to comment
https://forums.phpfreaks.com/topic/97657-approvedeny-form/#findComment-499688
Share on other sites

Is there an IF statement whereby if 'approved' is selected i can add points; if 'deny' is selected i can delete photo? And the display i will just list all files in a directory, which i can currently do.

 

So basically just a form with 2 radio buttons, with 2 IF statements with them. Update dababase for one and delete image from server in another?

Link to comment
https://forums.phpfreaks.com/topic/97657-approvedeny-form/#findComment-500823
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.