
php -f /path/to/file.php
The File is in public_html/Panel/test.php
In responce to FlorX i changed the times to run a minute after
public_html and www are the same. Doesnt cpanel set you a cron up anymore?
None of the codes that have been posted so far work.
Any more or have an ideas why they don't work
Use cpanel for when you run it and my code, it works because I use it myself for my own cronjob.
php -f /home/habbocou/www/Panel/test.php
That then?
Yes, assuming you have cpanel, add it in there, use the basic view and not the advanced view when you click cron jobs. That way you can set the time easily.
I'm beginning to sound a real noob now. It still won't work.
Any ideas.
The File i want it to run is below
PHP Code:<?php
include("config.php");
mysql_query("TRUNCATE TABLE table");
$query = mysql_query("SELECT * FROM `staff` ORDER BY RAND() LIMIT 3") or die('Could not delete request: '.mysql_error());
while ($view = mysql_fetch_array($query)) {
mysql_query("INSERT INTO `table` (`name`, `day`) VALUES ('{$view["username"]}', '$numday')") or die ("Error");
}
mail("[email protected]", "Cron Sucessful", "The Cron Job was Sucessful");
?>
Want to hide these adverts? Register an account for free!