Set a timer to server clock

Hi guys,

I want to set a timer on my site timed to the server clock to start running upon the execution of a certain script and then after the designated time expires, I want another script to run.

How complex is this does anyone have any php code examples?

thanks in advance

Silversurfer

Hi,

Take a look here: http://codeaid.net/php/calculate-script-execution-time-(php-class) I have used something similar before and it works well for what you describe.

Regards,
Steve

Thanks serverstorm, as it’s you I’ll explain why I’m doing this, I want to automatically delete that sensitive data after a week to make sure that I don’t hang onto it longer than necessary and therefore eliminate the need to do it manually.
thanks again

Hi Steve,

From what I can understand, that script is just a very accurate timing script, I suppose what I really want to do is schedule the deletion script to run after say a week. What is the best option for this?

Have you considered a cron job? The cron job could be set to run at the same time each day and if the data has been stored for less then 7 days it’s left alone, if it’s been stored for 7 or anything over 7 days it gets deleted.

Yeh I did read about that I was going to ask our hosting to schedule one to tell my deletion script to run. Do you think it would be more practical to tunnel in with a cron job shell command and delete like that, its jus tthat I don’t know the shell at all, only, php.