Jump to content

setting up a time for unlink?


xcoderx

Recommended Posts

a very simple way would be using AJAX (jQuery/MooTools) .. with AJAX, you can set a timer to execute a file of your choice asynchronously on the server.  that file could be to delete a file, or whatever you like.

 

it could work like such:  person reaches link/page; countdown timer commences; 0 is reached, AJAX runs unlink.php?file=file_to_be_removed.txt;

 

i have no idea how your system is setup, but anytime you are dealing with deleting files, etc., security is crucial.

i know you can write a CRON job with PHP.  i've never played around with it, but you could use it to write a cron to be execute 1 minute from that point in time, and have the cron run you deletion script/file.

 

need to be able to use exec() on your server.

daniel bro with @ i get Warning: Unexpected character in input: ''' (ASCII=39) state=1 in

 

at is a unix command. Like this:

daniel@daniel-laptop:~$ at -h
Usage: at [-V] [-q x] [-f file] [-mldbv] timespec ...
       at [-V] [-q x] [-f file] [-mldbv] -t time
       at -c job ...
       atq [-V] [-q x]
       atrm [-V] job ...
       batch

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.