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