first off, Sorry if this is in wrong topic, this just seems a logical palce to put it.
-----
Im makin a Text-Based RPG game (theoutfit.exofire.net/outfit/index.php)
& i have a cron writtin to make the health,Brave (nerve,courage w/e u wanna call it) & will go up every 5 minutes. I dont think my coding is wrong but here it is:
<?php
include "mysql.php";-----
Im makin a Text-Based RPG game (theoutfit.exofire.net/outfit/index.php)
& i have a cron writtin to make the health,Brave (nerve,courage w/e u wanna call it) & will go up every 5 minutes. I dont think my coding is wrong but here it is:
<?php
global $c, $mykey;
$path=$_SERVER['HTTP_HOST'].str_replace('cron_fivemins.php','',$_SERVER['SCRIPT_NAME']);
if($_GET['code'] != md5($path.$mykey))
{
exit;
}
$query="UPDATE users SET energy=energy+(maxenergy/(12.5)) WHERE energy<maxenergy";
$query2="UPDATE users SET energy=maxenergy WHERE energy>maxenergy";
$query3="UPDATE users SET will=will+10 WHERE will<maxwill";
$query4="UPDATE users SET will=maxwill WHERE will>maxwill";
mysql_query($query,$c) or die("\nError Executing Query 1 for updating users $i to $next\n$query\n".mysql_error()."\nError Code:".mysql_errno());
mysql_query($query2,$c) or die("\nError Executing Query 2 for updating users $i to $next\n$query2\n".mysql_error()."\nError Code:".mysql_errno());
mysql_query($query3,$c) or die("\nError Executing Query 3 for updating users $i to $next\n$query3\n".mysql_error()."\nError Code:".mysql_errno());
mysql_query($query4,$c) or die("\nError Executing Query 4 for updating users $i to $next\n$query4\n".mysql_error()."\nError Code:".mysql_errno());
$query="UPDATE users SET brave=brave+((maxbrave/10)+0.5) WHERE brave<maxbrave ";
$query2="UPDATE users SET brave=maxbrave WHERE brave>maxbrave";
$query3="UPDATE users SET hp=hp+(maxhp/3) WHERE hp<maxhp";
$query4="UPDATE users SET hp=maxhp WHERE hp>maxhp";
mysql_query($query,$c) or die("\nError Executing Query 1 for updating users $i to $next\n$query\n".mysql_error()."\nError Code:".mysql_errno());
mysql_query($query2,$c) or die("\nError Executing Query 2 for updating users $i to $next\n$query2\n".mysql_error()."\nError Code:".mysql_errno());
mysql_query($query3,$c) or die("\nError Executing Query 3 for updating users $i to $next\n$query3\n".mysql_error()."\nError Code:".mysql_errno());
mysql_query($query4,$c) or die("\nError Executing Query 4 for updating users $i to $next\n$query4\n".mysql_error()."\nError Code:".mysql_errno());
?>
---Thats Code
& its directory should be: /home/trill07/public_html/outfit/cron_fivemins.php
But i was readin a tutorial by cory sayin to do this:
php -q/home/trill07/public_html/cron_fivemins.php . wich seeing as the other directory didnt work i decided to try that, Still nothing. i have the time thing set to: 5-0-*-*-*
--
Anyone tell me whats wrong id REALLY appreciate it
Edit:
I know i messed up the code.... i fixed it & executed the script manually & it works but it wont work with crontab off of CPanel. Do we have to get it turned on by an admin or something??
Last edited: