Ik heb een cron script:
Code
$RunLog = 'includes/crons/hour.log'; //make sure you have this file downloaded tooif (file_exists($RunLog)) { $lastRun = file_get_contents($RunLog); if (time() - $lastRun >= 3600) { //This will check last time file ran. Right now if it's less than an hour it will rerun your file.$cron= file_get_contents('http://'.$_SERVER['SERVER_NAME'].'/includes/crons/hour.php'); // here you put the link for your file or the php code file_put_contents($RunLog, time()); } }
Na een uur wordt de cron gerunt. Het probleem is nu dat wanneer ik rechtsstreeks naar het cron script http://www.mijndomein.nl/includes/crons/hour.php ga de update ook wordt uitgevoerd. Wat ik nu wil is dat ik het hour.php script beveilig zodat deze alleen wordt uitgevoerd na de 3600 seconden met behulp van mijn cron script
Dit is mijn hour.php
Iemand enig idee hoe ik dit kan doen?