Author Topic: Page Not Showing...  (Read 272 times)

0 Members and 1 Guest are viewing this topic.

Offline dean7Topic starter

  • Enthusiast
  • Posts: 257
  • Gender: Male
    • View Profile
Page Not Showing...
« on: March 12, 2010, 04:29:38 PM »
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:

Code: [Select]
<?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 == && $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 ==&& $speed->mph <1){
echo ("You Lost! Your Car Needs To Be At 1mph Or Faster!"); 
}elseif (
$race ==&& $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 ==&& $speed->mph <10){
echo ("You Lost! Your Car Needs To Be 10mph Or Faster!");
}elseif(
$race ==&& $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 ==&& $speed->mph <25){
echo ("You Lost! Your Car Needs To Be 25mph Or Faster!");
}elseif (
$race ==&& $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 ==&& $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

Offline FD_F

  • Enthusiast
  • Posts: 61
  • Gender: Male
    • View Profile
Re: Page Not Showing...
« Reply #1 on: March 12, 2010, 05:34:09 PM »
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);



Offline dean7Topic starter

  • Enthusiast
  • Posts: 257
  • Gender: Male
    • View Profile
Re: Page Not Showing...
« Reply #2 on: March 13, 2010, 01:23:55 PM »
After doing that nothing has changed.. It doesnt show any errors either...

Offline PFMaBiSmAd

  • Guru
  • 'Insane!'
  • *
  • Posts: 14,588
  • In Coding, Automatic means you write code to do it
    • View Profile
Re: Page Not Showing...
« Reply #3 on: March 13, 2010, 01:30:16 PM »
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 >=

« Last Edit: March 13, 2010, 01:33:44 PM by PFMaBiSmAd »
Signature: (not a comment about anything you posted unless specifically indicated)
Debugging step #1: To get past the garbage-out equals garbage-in stage in your code, you must check that the inputs to your code are what you expect.

Programming is just problem solving, but it is done in another language. You must learn enough of the programming language you are using to be able to read and write code.