Jump to content

Page Not Showing...


dean7

Recommended Posts

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

Link to comment
Share on other sites

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 >=

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.