Monkey644 Posted July 3, 2010 Share Posted July 3, 2010 hey guys, i keep getting this error, and have had a few more... Notice: Undefined index: code in /home/********/public_html/cron_hour.php on line 5 <?php error_reporting(E_ALL); 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']; } $db->query("UPDATE gangs SET gangCHOURS=gangCHOURS-1 WHERE gangCRIME>0"); $q=$db->query("SELECT g.*,oc.* FROM gangs g LEFT JOIN orgcrimes oc ON g.gangCRIME=oc.ocID WHERE g.gangCRIME > 0 AND g.gangCHOURS = 0"); while($r=$db->fetch_row($q)) { $suc=rand(0,1); if($suc) { $log=$r['ocSTARTTEXT'].$r['ocSUCCTEXT']; $muny=(int) (rand($r['ocMINMONEY'],$r['ocMAXMONEY'])); $log=str_replace(array("{muny}","'"),array($muny,"''"),$log); $db->query("UPDATE gangs SET gangMONEY=gangMONEY+$muny,gangCRIME=0 WHERE gangID={$r['gangID']}"); $db->query("INSERT INTO oclogs VALUES ('',{$r['ocID']},{$r['gangID']}, '$log', 'success', $muny, '{$r['ocNAME']}', unix_timestamp())"); $i=$db->insert_id(); $qm=$db->query("SELECT * FROM users WHERE gang={$r['gangID']}"); while($rm=$db->fetch_row($qm)) { event_add($rm['userid'],"Your Gang's Organised Crime Succeeded. Go [url='oclog.php?ID=$i']here[/url] to view the details.",$c); } } else { $log=$r['ocSTARTTEXT'].$r['ocFAILTEXT']; $muny=0; $log=str_replace(array("{muny}","'"),array($muny,"''"),$log); $db->query("UPDATE gangs SET gangCRIME=0 WHERE gangID={$r['gangID']}"); $db->query("INSERT INTO oclogs VALUES ('',{$r['ocID']},{$r['gangID']}, '$log', 'failure', $muny, '{$r['ocNAME']}', unix_timestamp())"); $i=$db->insert_id(); $qm=$db->query("SELECT * FROM users WHERE gang={$r['gangID']}"); while($rm=$db->fetch_row($qm)) { event_add($rm['userid'],"Your Gang's Organised Crime Failed. Go [url='oclog.php?ID=$i']here[/url] to view the details.",$c); } } } if(date('G')==17) { $db->query("UPDATE users u LEFT JOIN userstats us ON u.userid=us.userid LEFT JOIN jobs j ON j.jID=u.job LEFT JOIN jobranks jr ON u.jobrank=jr.jrID SET u.money=u.money+jr.jrPAY, u.jobpoints=u.jobpoints+jr.jrPOINTS, u.exp=u.exp+(jr.jrPAY/20) WHERE u.job > 0 AND u.jobrank > 0 AND laston>unix_timestamp()-172800"); $db->query("UPDATE users u LEFT JOIN userstats us ON u.userid=us.userid LEFT JOIN jobs j ON j.jID=u.job LEFT JOIN jobranks jr ON u.jobrank=jr.jrID SET u.money=u.money+jr.jrPAY WHERE u.job > 0 AND u.jobrank > 0 AND laston>unix_timestamp()-172800"); } if($set['validate_period'] == 60 && $set['validate_on']) { $db->query("UPDATE users SET verified=0"); } $db->query("UPDATE users SET minus_clicks=0 WHERE userid=$userid"); $db->query("UPDATE users SET clickend=0 WHERE userid=$userid"); { $db->query(sprintf("UPDATE users SET view_tv = %u, sleep_sofa = %u",0,0)); } ?> Quote Link to comment Share on other sites More sharing options...
Zero-Affect Posted July 4, 2010 Share Posted July 4, 2010 <?php include "config.php"; global $_CONFIG; if ( $_GET['code'] != $_CONFIG['code'] ) { echo 'Buzz off!'; die($h->endpage()); } define("MONO_ON", 1); That's my top lines. Quote Link to comment Share on other sites More sharing options...
Monkey644 Posted July 6, 2010 Author Share Posted July 6, 2010 im now getting these errors Notice: Undefined index: code in /home/*********/public_html/cron_hour.php on line 5 Buzz off! Notice: Undefined variable: h in /home/*********/public_html/cron_hour.php on line 7 Fatal error: Call to a member function endpage() on a non-object in /home/*********/public_html/cron_hour.php on line 7 Quote Link to comment Share on other sites More sharing options...
ddgamedesign Posted July 6, 2010 Share Posted July 6, 2010 Here's my top lines in hour cron, and it works fine: <?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; Quote Link to comment Share on other sites More sharing options...
Danny696 Posted July 6, 2010 Share Posted July 6, 2010 I hope your doinf cron_hour.php?code=bjhjhsjhs Quote Link to comment Share on other sites More sharing options...
Monkey644 Posted July 8, 2010 Author Share Posted July 8, 2010 Now im getting: Notice: Undefined variable: userid in /home/********/public_html/cron_hour.php on line 66 Fatal error: Call to undefined function event_add() in /home/********/public_html/class/class_db_mysql.php on line 91 Quote Link to comment Share on other sites More sharing options...
corruptcity || skalman Posted July 9, 2010 Share Posted July 9, 2010 when you entered your crons into the crontab did you put cron_day.php?code=the code that is in theconfig.php file if not it wont work so what you need todo is open config.php find the code it a string full of numbers and letteres and its above the ?> you really cant miss it and ill even post the code to show u <?php $_CONFIG = array( 'hostname' => 'localhost', 'username' => , 'password' => '', 'database' => , 'persistent' => 0, 'driver' => 'mysql', 'code' => 'this is where the code lives that you need!' ); ?> then once uve got that you add the ?code=what your code is from config.php there then click save or ok or what ever then your done its a good idea to just try the 5 mins cron 1st then go to the gym waste a little nrg wait 5 mins then see if its gone back up Quote Link to comment Share on other sites More sharing options...
Monkey644 Posted July 12, 2010 Author Share Posted July 12, 2010 Yes i have run it with the code, but thats the errors that i keep getting. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.