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

Reply

Join Date: Aug 2004
Posts: 22
Reputation: Decency is an unknown quantity at this point 
Solved Threads: 1
Decency Decency is offline Offline
Newbie Poster

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

 
0
  #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
Reply With Quote Quick reply to this message  
Join Date: Feb 2005
Posts: 355
Reputation: DanceInstructor is an unknown quantity at this point 
Solved Threads: 14
DanceInstructor's Avatar
DanceInstructor DanceInstructor is offline Offline
Posting Whiz

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

 
0
  #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 Quick reply to this message  
Join Date: Aug 2004
Posts: 22
Reputation: Decency is an unknown quantity at this point 
Solved Threads: 1
Decency Decency is offline Offline
Newbie Poster

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

 
0
  #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 Quick reply to this message  
Join Date: Apr 2004
Posts: 759
Reputation: Killer_Typo will become famous soon enough Killer_Typo will become famous soon enough 
Solved Threads: 35
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 ?

 
0
  #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?
Dont forget to spread the reputation to those that deserve!
Reply With Quote Quick reply to this message  
Join Date: Feb 2005
Posts: 355
Reputation: DanceInstructor is an unknown quantity at this point 
Solved Threads: 14
DanceInstructor's Avatar
DanceInstructor DanceInstructor is offline Offline
Posting Whiz

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

 
1
  #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 Quick reply to this message  
Join Date: Aug 2004
Posts: 22
Reputation: Decency is an unknown quantity at this point 
Solved Threads: 1
Decency Decency is offline Offline
Newbie Poster

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

 
0
  #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 Quick reply to this message  
Join Date: Nov 2003
Posts: 360
Reputation: Gary King will become famous soon enough Gary King will become famous soon enough 
Solved Threads: 5
Team 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 ?

 
0
  #7
Apr 5th, 2005
I think you need the right file system permissions.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the PHP Forum
Thread Tools Search this Thread



Tag cloud for PHP
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC