Welcome to HBH! If you had an account on hellboundhacker.org you will need to reset your password using the Lost Password system before you will be able to login.

Cron Jobs


alldatizholy's Avatar
Member
0 0

i really need help with crons, i need to make it so my members get back life once 5 mins have been up and its not happening, can someone please tell me what i could do to fix this? here is of the codemarkup<?php include "config.php"; global $_CONFIG; if($_GET['code'] != $_CONFIG['code']) { die(""); } define("MONO_ON", 1); require "class/class_db_{$_CONFIG['driver']}.php"; $db=new database; $db->configure($_CONFIG['hostname'], $_CONFIG['username'], $_CONFIG['password'], $_CONFIG['database'], $_CONFIG['persistent']); $db->connect(); $c=$db->connection_id; $set=array(); $settq=$db->query("SELECT * FROM settings"); while($r=$db->fetch_row($settq)) { $set[$r['conf_name']]=$r['conf_value']; } //brave update $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"; $db->query($query); $db->query($query2); $db->query($query3); $db->query($query4); //enerwill update $query="UPDATE users SET energy=energy+(maxenergy/(12.5)) WHERE energy<maxenergy AND donatordays=0"; $query5="UPDATE users SET energy=energy+(maxenergy/(6)) WHERE energy<maxenergy AND donatordays>0"; $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"; $db->query($query); $db->query($query5); $db->query($query2); $db->query($query3); $db->query($query4); if($set['validate_period'] == 5 && $set['validate_on']) { $db->query("UPDATE users SET verified=0"); } if($set['validate_period'] == 15 && $set['validate_on'] && in_array(date('i'),array("00", "15", "30", "45"))) { $db->query("UPDATE users SET verified=0"); } ?>


Mr_Cheese's Avatar
0 1

what does crontab -l look like? maybe you got the cronjob line wrong?


alldatizholy's Avatar
Member
0 0

i have no idea where that is so i take it thats my problem…..now to figure out where and what that is


ghost's Avatar
0 0

Your CPanel should give you access to your crons… unless you're running your own web server, in which case the crontab command in a local terminal would work (if you're running it on Linux). Also, slightly OT… why are you using PEAR? Unless you're using a RDBMS other than MySQL, just use regular PHP.

You should explain your environment more to get meaningful help.


alldatizholy's Avatar
Member
0 0

this is what the cron job looks like now, oh and btw i just looked at it….i just changed the ***** to 00*** for the cron day so thats fixed


ghost's Avatar
0 0

Why are you passing a query string into your cron jobs? Not that that would be the problem… just curious.

Looks like your every 5 min cron is set up right… not sure what the problem is, unless your script is off. Do you get any sign that the cron job is actually running as scheduled? Like, the usual email?

Edit: Yep, it's your code. Quit putting semi-colons after the strings you're passing into functions. Like this…

$settq=$db->query("SELECT * FROM settings";);

… and the die at the top, and probably a few others.


alldatizholy's Avatar
Member
0 0

ok so what should i do? cause im so damn lost right now its not even funny


ghost's Avatar
0 0

alldatizholy wrote: ok so what should i do? cause im so damn lost right now its not even funny

Well, first, you should read my fucking post so you can see what the problem is. Next… you should fix the problem.

If you don't have the PHP knowledge to fix a simple, repeated syntax mistake, then you need to close out of your CPanel and your pirated copy of Dreamweaver and re-learn the basics.


alldatizholy's Avatar
Member
0 0

ur an asshole….fuck off man i asked for help and people like u act all bad cause u have knowledge…..


Futility's Avatar
:(
80 120

And yet you decide to insult him and act like an idiot rather than appealing to his better side and getting some of that knowledge out of him… Good choice.


alldatizholy's Avatar
Member
0 0

like i said, im confused and i need help and what does he do….he acts like an ass, ive been looking it up for a while now and im confused, all i wanted was some better explained help


ghost's Avatar
0 0

alldatizholy wrote: ur an asshole….fuck off man i asked for help and people like u act all bad cause u have knowledge…..

Oh, okay… like I haven't heard that before when I've helped someone that prefers a good spoon-feed. Seriously, you want it explained simpler than this…

Zephyr_Pure wrote: Quit putting semi-colons after the strings you're passing into functions.

If it gets any simpler than that, your brain will shut down. So, go fix your fucking code and die in a hole, you ungrateful little shithead.


ghost's Avatar
0 0

Yeah; he told you pretty plainly. If you can't fix that, you shouldn't even be looking at the code at all.