dean7 Posted March 12, 2010 Share Posted March 12, 2010 Hi all, On my website i have something where you race the computer with a chance in winning or losing but i seem to have a problem with it... Heres the code: <?php session_start(); // Lets start including!!!! include ("includes/config.php"); include ("includes/functions.php"); // Finished Including. // Add logged in info here once finished! $username = $_SESSION['username']; $find = mysql_query("SELECT * FROM users WHERE username = '$username'"); $got = mysql_fetch_object($find); $getspeed = mysql_query("SELECT * FROM garage WHERE username = '$username'"); $speed = mysql_fetch_object($getspeed); if ($got->carin == '0'){ echo ("You Must Be In A Car To Race!"); } else{ echo ("<center>You Are In Your Car: $got->carin .</center>"); } if (strip_tags($_POST['race']) && strip_tags($_POST['race_person'])){ $race = strip_tags($_POST['race_person']); if ($race == 1 && $speed->mph =>1){ $name = "Dean"; $wonrep = "100"; $moneyget = "1000"; echo ("You Won The Race Agients $name, and gained $rep rep and $pound;$moneyget"); } elseif ($race ==1 && $speed->mph <1){ echo ("You Lost! Your Car Needs To Be At 1mph Or Faster!"); }elseif ($race ==2 && $speed->mph =>10){ $name = "Ben"; $wonrep = "200"; $moneyget = "1000"; echo ("You Won The Race Agients $name, and gained $rep rep and $pound;$moneyget"); }elseif ($race ==2 && $speed->mph <10){ echo ("You Lost! Your Car Needs To Be 10mph Or Faster!"); }elseif($race ==3 && $speed->mph =>25){ $name = "Amy"; $wonrep = "400"; $moneyget = "4000"; echo ("You Won The Race Agients $name, and gained $rep rep and $pound;$moneyget"); }elseif ($race ==3 && $speed->mph <25){ echo ("You Lost! Your Car Needs To Be 25mph Or Faster!"); }elseif ($race ==4 && $speed->mph =>50){ $name = "Stacey"; $wonrep = "800"; $moneyget = "8000"; echo ("You Won The Race Agients $name, and gained $rep rep and $pound;$moneyget"); }elseif ($race ==4 && $speed->mph <50){ echo ("You Lost! Your Car Needs To Be 50mph Or Faster!"); } } // Racing People Is Done For Now! $moneynow = $got->money+$moneyget; $rep = $got->rep+$wonrep; mysql_query("UPDATE users SET money='$moneynow' AND rep='$rep' WHERE username='$username'"); ?> When its displayed in the browser it just shows a white page... Ive checked over the code see if there is anything missed out.. But i carnt see nothing... Anyone else see why its doing it? Also if needing the form please ask Quote Link to comment https://forums.phpfreaks.com/topic/195058-page-not-showing/ Share on other sites More sharing options...
FD_F Posted March 12, 2010 Share Posted March 12, 2010 you have syntax error to display errors add on the top of the code this lines: error_reporting(E_ALL); ini_set("display_errors", 1); Quote Link to comment https://forums.phpfreaks.com/topic/195058-page-not-showing/#findComment-1025389 Share on other sites More sharing options...
dean7 Posted March 13, 2010 Author Share Posted March 13, 2010 After doing that nothing has changed.. It doesnt show any errors either... Quote Link to comment https://forums.phpfreaks.com/topic/195058-page-not-showing/#findComment-1025657 Share on other sites More sharing options...
PFMaBiSmAd Posted March 13, 2010 Share Posted March 13, 2010 Setting those two values in your script has no effect on displaying fatal parse errors because your script is never executed to set those two values. You should be developing and debugging php code on a system where those two values are set in your master php.ini. Edit: Once you do that, you will find that your greater-than or equal comparisons using => should in fact be >= Quote Link to comment https://forums.phpfreaks.com/topic/195058-page-not-showing/#findComment-1025658 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.