• cron1.php


    cron_hour.php


    cron1.php is working great withot setup cpanel.
    But cron_hour.php doest work .. without setup cpanel cronjob..
    Can sb setup me.. that way..it woluld work without cpanel setup cronjob?

  • Guest, wil je besparen op je domeinnamen? (ad)
  • Did you fill in your database data?


    PHP
    $host = "localhost"; //Your host
    $user = "database_username"; //Your username
    $passwd = "database_password"; //Your password
    $database = "database_naam"; //Name of the database


    It's at the top of cron_hour.php ;)


    Can you explain what cron_hour.php has to do?

  • cronjobs moeten altijd uitgevoerd worden via een cpanel etc. of een timer maken


    PHP
    $update = mysql_fetch_query("SELECT time FROM cron WHERE name = 'hour' LIMIT 1");
      $lol = $update['time'];
      
      if(tijd() - strtotime($lol) >= 3600) {
        $update = floor((tijd() - strtotime($lol)) / 3600);


    Dit staat in zijn code, let in het vervolg op voordat je iets zegt.
    Al zou ik het inderdaad via Cronjobs doen.

  • It is possible to run hourly tasks without setting up a cronjob, but then you need to record in the database the last time the task was executed and then when a user visits your site, check how long ago the hourly cronjob ran.
    If it was 3 hours ago, you just run the cron_hour 3 times instead of just once.


    But the easiest and best solution is to just set up the cronjob in cpanel.


    Ps: in case you do not like cpanel, you can also use external sites and services to run your cronjobs.
    Some sites offer a service where they call a by you defined script on a by you defined time interval.
    That way you can very easily outsource the running of your cronjobs.

Participate now!

Heb je nog geen account? Registreer je nu en word deel van onze community!