mrmmb Posted January 28, 2009 Posted January 28, 2009 Hello everyone! For testing purposes, I am using 000webhosting.com to test out my game before I commit to a good hosting company. So far, so good, but I am stuck with setting up cron jobs which normally would be easy, esp on cpanel. Ive already tried a few online cron job services, but they are not reliable and I don't want to pay. Basically, 000webhosting.com does not allow the use of invalid characters in the cron job url. So in my case: cron_fivemins.php?code=b4d92d8bf20921978ba31f ....the "?" and "=" are invalid. On their support forum they suggest putting "b4d92d8bf20921978ba31f" within cron_fivemins.php. Is that possible? If so, how? Thanks in advance for any help or advice. Mel Quote
Sim Posted January 28, 2009 Posted January 28, 2009 Re: Cron job question Could you enter a URL like path_to_your_game/code/YOUR REAL CODE/ if so you could use .htaccess to modrewrite =) Quote
Sim Posted January 28, 2009 Posted January 28, 2009 Re: Cron job question sorry for double post. I thought of an easier way to do it. remove the if statement where it says if CODE = then rename the file so other people can't access the cron_file. and just point directly to the file. Quote
mrmmb Posted January 29, 2009 Author Posted January 29, 2009 Re: Cron job question Thanks for the reply. so rename the file, for example, job_5mins.php and instead of job_fivemins.php?code=b4d92d8bf20921978ba31f use job_fivemins.phpb4d92d8bf20921978ba31f Is that what you mean? Quote
Guest Anonymous Posted January 29, 2009 Posted January 29, 2009 Re: Cron job question Allow From <IP> (Apache Specific) Quote
Sim Posted January 29, 2009 Posted January 29, 2009 Re: Cron job question Thanks for the reply. so rename the file, for example, job_5mins.php and instead of job_fivemins.php?code=b4d92d8bf20921978ba31f use job_fivemins.phpb4d92d8bf20921978ba31f Is that what you mean? no. like this instead of cron_day.php rename it to cron_dayz.php or something else so people will not know the file. put this code in it <?php /* MCCodes Lite cron_day.php Rev 1.0.0 Copyright (C) 2006 Dabomstew This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ include "mysql.php"; global $c, $mykey; $path=$_SERVER['HTTP_HOST'].str_replace('cron_day.php','',$_SERVER['SCRIPT_NAME']); mysql_query("UPDATE users SET daysold=daysold+1",$c); mysql_query("UPDATE users SET mailban=mailban-1 WHERE mailban > 0",$c); mysql_query("UPDATE fedjail set fed_days=fed_days-1",$c); mysql_query("UPDATE users u LEFT JOIN fedjail f ON u.fedjail=f.fed_id SET u.fedjail=0 WHERE f.fed_days=0",$c); mysql_query("DELETE FROM fedjail WHERE fed_days=0",$c); ?> instead of cron_fivemins.php rename it to cron_fiveminz.php or something else so people will not know the file. put this code in it <?php /* MCCodes Lite cron_fivemins.php Rev 1.0.1 Copyright (C) 2006 Dabomstew This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ include "mysql.php"; global $c, $mykey; $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()); ?> Quote
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.