RSS Forums RSS
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 9654 | Replies: 6
Reply
Join Date: Aug 2004
Posts: 22
Reputation: Decency is an unknown quantity at this point 
Rep Power: 5
Solved Threads: 1
Decency Decency is offline Offline
Newbie Poster

How can i delete unused and unneeded images from a folder using php ?

  #1  
Apr 2nd, 2005
Hi all
i need to know if there is by a way by any chance to delete unused images from my virtual directory or wwwroot folder dunamically on the user request using php ?
thank you all
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Feb 2005
Posts: 354
Reputation: DanceInstructor is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 12
DanceInstructor's Avatar
DanceInstructor DanceInstructor is offline Offline
Posting Whiz

Re: How can i delete unused and unneeded images from a folder using php ?

  #2  
Apr 2nd, 2005
Yes this should be possible. There may be some scripts already written to do this although I am not aware of them. You could try searches on google and yahoo to see what you can find. If you don't find anything useful, you will find most of the php functions you will need here.
Clear Mind Hosting and Web Design

If I've helped you please consider adding to my reputation.
Reply With Quote  
Join Date: Aug 2004
Posts: 22
Reputation: Decency is an unknown quantity at this point 
Rep Power: 5
Solved Threads: 1
Decency Decency is offline Offline
Newbie Poster

Re: How can i delete unused and unneeded images from a folder using php ?

  #3  
Apr 3rd, 2005
thank you for such a wonderful reference you gave me
i checked it out and found the way to delete files and folders
and it was just so simple lol

for your reference the code is as this :

<?php

unlink("filename");

?>

can it be more simple ?
lol
Reply With Quote  
Join Date: Apr 2004
Location: Tracy
Posts: 744
Reputation: Killer_Typo will become famous soon enough Killer_Typo will become famous soon enough 
Rep Power: 7
Solved Threads: 32
Killer_Typo's Avatar
Killer_Typo Killer_Typo is offline Offline
Master Poster

Re: How can i delete unused and unneeded images from a folder using php ?

  #4  
Apr 3rd, 2005
Originally Posted by Decency
thank you for such a wonderful reference you gave me
i checked it out and found the way to delete files and folders
and it was just so simple lol

for your reference the code is as this :

<?php

unlink("filename");

?>

can it be more simple ?
lol

is that the same for deleting folders too?
!!!!! WARNING YOUR COMPUTER MAY BE INFECTED WITH SPYWARE!!!! PAY AN OVER PRICED AMMOUNT TO HAVE SOMTHING FIXED WE PLACED THERE IN THE FIRST PLACE!!!!!!!!!

sound familiar, know how to block yourself and keep yourself clean.
_____________________
http://www.lavasoftusa.com/ -->adaware
http://www.safer-networking.org/en/index.html -->spybot S&D
http://www.javacoolsoftware.com/spywareblaster.html -->spywareblaster
http://www.javacoolsoftware.com/spywareguard.html -->spywareguard
_____________________
and dont forget to spread the reputation to those that deserve!
Reply With Quote  
Join Date: Feb 2005
Posts: 354
Reputation: DanceInstructor is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 12
DanceInstructor's Avatar
DanceInstructor DanceInstructor is offline Offline
Posting Whiz

Re: How can i delete unused and unneeded images from a folder using php ?

  #5  
Apr 4th, 2005
To remove a directory:

rmdir('directory_name');
Clear Mind Hosting and Web Design

If I've helped you please consider adding to my reputation.
Reply With Quote  
Join Date: Aug 2004
Posts: 22
Reputation: Decency is an unknown quantity at this point 
Rep Power: 5
Solved Threads: 1
Decency Decency is offline Offline
Newbie Poster

Re: How can i delete unused and unneeded images from a folder using php ?

  #6  
Apr 4th, 2005
yeah its the same but sometimes the delete() function does not work on certain systems so you will need to use unlink() or unset()
Reply With Quote  
Join Date: Nov 2003
Location: Toronto, Canada
Posts: 354
Reputation: Gary King will become famous soon enough Gary King will become famous soon enough 
Rep Power: 7
Solved Threads: 5
Colleague
Gary King's Avatar
Gary King Gary King is offline Offline
PHP/vBulletin Guru

Re: How can i delete unused and unneeded images from a folder using php ?

  #7  
Apr 5th, 2005
I think you need the right file system permissions.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 4:40 am.
Newsletter Archive - Sitemap - Privacy Statement - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC