Then I have a .cfm page that performs a database SELECT query to gather all the images and display them on the page. Also pretty simple.
I have added a checkbox next to each image that is loop-generated for the display page, and if you check this box and then hit the form submit button, it deletes the image from the database. Works great.
<cfquery name="getdetails" datasource="#datasource#"> SELECT sm_image,imgid FROM gallery </cfquery> <table width="650" align="center"> <cfloop>***Loop runs here to populate the page with images; loop includes the checkbox*** <form method="post" name="deleteSelected" action="delete_images.cfm" enctype="multipart/form-data"> <cfoutput> <input type="checkbox" name="delete" value="#imgid#">Delete </cfoutput> </cfloop> <input name="Submit" type="submit" value="Modify Data" class="submit"> </form> </table>
Upon checking the box next to the desired image to delete, this action page is called...
<cfif isDefined("form.delete")> <cfloop list="#form.delete#" index="i"> <cfquery name="delete" datasource="#datasource#"> DELETE FROM gallery WHERE imgid = #i# </cfquery> </cfloop> </cfif>
This loops through the database deleting the image that has the same imgid as the one checked in the form.
What I would like to do is add another check box called rotate, and if that is checked then run a cf script that rotates the image in 45 degree increments. I am not sure how to do this. I am having trouble figuring out how to match the checked image to the one in the folder. I think I can use the same concept as above to target the image via the database, but how do I then perform the rotate and save the image back to the folder?
I'm stumped. Any ideas, tips, or tricks will be greatly appreciated. Thanks!!