Delete temporary images after loading website



Hi there,

I am writing a PHP script which generates some charts using gnuplot.
This generates quite a large number of temporary image files. My
problem is that I do not know how to delete these images after they
have been loaded and are already displayed at the website.
Everything I have tried so far resulted in that the images were not
displayed at all.
I already tried something like:

sleep(10);
foreach ($images as $i) {
unlink($i);
}

also tried writing a shell script with the same functionality hoping
that starting the shell script in the background (using &) would
terminate the php script before the images were deleted.
Didn't work either.
Does anyone have an idea? I do not want to use a cron job or something
to clean the temporary directory.
Are there any php only solutions to this problem?

Cheers!
Andrea

.



Relevant Pages

  • need help with ecard home page - was PHP tutor in San Francisco
    ... My thanks to all the people who offered to help me with homework assignment for the PHP class I'm taking. ... The assignment requires the PHP script to randomly display 16 thumbnails and when the user clicks on one of them, ... I don't understand why this is, since there are 139 images. ...
    (comp.lang.php)
  • Rotating Images from a text file using PHP
    ... The images shoult have their own hyperlink & alt tag. ... The PHP Script should be able to retrieve the alt tag and hyperlink ...
    (php.general)
  • Re: PHP images and time
    ... I want to add a php script to my page that changes my collection of ... images based on the time of my computer. ... change the picture on the site, but it should not be random. ... img tag on your page. ...
    (php.general)
  • Hiding image filenames
    ... I have a PHP script which generates responses to answers submitted by a ... The responses contain links to images. ... guessing the names of other images and viewing them. ...
    (comp.lang.php)
  • Javascript/PHP interaction
    ... Suppose I have a bunch of DOM objects (namely images) and want to pass the ... attributes of these DOM objects to a PHP script. ...
    (comp.lang.php)