php deletion form

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
mrshock
Forum Newbie
Posts: 1
Joined: Sat Dec 20, 2008 12:56 pm

php deletion form

Post by mrshock »

hey, i currently run a image hosting website, http://www.imagebooth.net, but i need some help, every image has a code on the end (example: ajwdab2e2e2) i want to create a form, so if someone wants to delete an image, they simple enter there id into the form and hit a delete button, and the image id that matches with an id in the pics folder will get deleted,

any help appreciated

thanks,
cptnwinky
Forum Commoner
Posts: 84
Joined: Sat Dec 27, 2008 10:58 am
Location: Williamstown, MA

Re: php deletion form

Post by cptnwinky »

If the id is physically appended to the file name, like image.jpgajwdab2e2e2 or any variation of that (image.ajwdab2e2e2.jpg) then you will need to use something to recurse over the directory files (dependent on which php version your using) and then use a regular expression to find that specific image.

If you can give me anymore info such as which version of php your using and what the image name with the code actually looks like. I could help whip up some quick code.
Post Reply