WarDeities Posted February 5, 2008 Share Posted February 5, 2008 I have a quick question...does anyone know if you can write a <META HTTP-EQUIV = 'Refresh' Content = '1; URL =cronname.php'> statement in php with a cron job. Heres what I am trying to do...I have a mmorpg and I want the cron job to run a file that randomly pick an npc from my database by their ID# and has it fight another person....the reason i ask if you can refresh is because a random number could end up giving me a result of a player that is inactive or other various results i don't want...and I'd like to write a statement to this extent... $randomnpc=($min,$max); $randomtarget=($min1,$max1); $userstats="SELECT * from *** where ID='$randomnpc'"; $userstats2=mysql_query($userstats) or die("Could not get user stats"); $userstats3=mysql_fetch_array($userstats2); $targetstats="SELECT * from *** where ID='$randomnpc'"; $targetstats2=mysql_query($targetstats) or die("Could not get user stats"); $targetstats3=mysql_fetch_array($targetstats2); $targetactive=$targetstats3[active]; if ($targetactive=='No') { <META HTTP-EQUIV = 'Refresh' Content = '1; URL =cronname.php'> } else { <META HTTP-EQUIV = 'Refresh' Content = '1; URL =fightpage.php?user=$userstats3[name]&target=$targetstats3[name]'> } Anyways I'm just not sure if it'll work...especially with cron jobs...I'm faily confendent that it will if I hit the button manualy, but I figured I'd ask before spending 3 hours programing it for it now to be able to happen! I really just want the cron to re-run itself if it gets and undesirable result!!! Thanks in advance!!! Link to comment https://forums.phpfreaks.com/topic/89497-meta-refresh-cron-jobs-php/ Share on other sites More sharing options...
WarDeities Posted February 5, 2008 Author Share Posted February 5, 2008 noone knows??? Link to comment https://forums.phpfreaks.com/topic/89497-meta-refresh-cron-jobs-php/#findComment-458851 Share on other sites More sharing options...
WarDeities Posted February 5, 2008 Author Share Posted February 5, 2008 noone huh....I guess I'll have to try it and see what happens...thank for looking everyone Link to comment https://forums.phpfreaks.com/topic/89497-meta-refresh-cron-jobs-php/#findComment-458970 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.