seany123 Posted September 25, 2008 Share Posted September 25, 2008 Im getting this error: Parse error: parse error, unexpected $ in blah on line 76 code: <?php include("lib.php"); define("PAGENAME", "Badge Car"); $player = check_user($secret_key, $db); $perc1 = $player->awake / $player->maxawake; $perc2 = $perc1 * 100; echo $perc2; $crime = rand(1,10); $jail = rand(1,10); if ($_GET['act'] == "go") { if($perc2 > 74 && $crime < 9) { } else if($crime > 8 && $jail < 3) { } else if($crime > { } else { if($perc2 > 48 && $perc2 < 75 && $crime < 7) { } else if($crime > 6 && $jail < 3) { } else if($crime > 6) { } else { if($perc2 > 24 && $perc2 < 49 && $crime < 5) { } else if($crime > 4 && $jail < 3) { } else if($crime > 4) { } else { if($perc2 > 0 && $perc2 < 25 && $crime < 3) { } else if($crime > 2 && $jail < 3) { } else if($crime > 2) { } } include("templates/private_header.php"); echo "So you've come for some training, huh?<br /><br />\n"; echo "<a href=\"crime1.php?act=go\">Train!</a>\n"; include("templates/private_footer.php"); ?> edit: it says the error is on the LAST line. Link to comment https://forums.phpfreaks.com/topic/125713-quick-error-needs-sorting/ Share on other sites More sharing options...
rarebit Posted September 25, 2008 Share Posted September 25, 2008 oh yeah line 76, I know it well, it's definitely not the one with the word 'blah' on it... Link to comment https://forums.phpfreaks.com/topic/125713-quick-error-needs-sorting/#findComment-650028 Share on other sites More sharing options...
seany123 Posted September 25, 2008 Author Share Posted September 25, 2008 what? i just put blah there to cover my website etc. Link to comment https://forums.phpfreaks.com/topic/125713-quick-error-needs-sorting/#findComment-650029 Share on other sites More sharing options...
PFMaBiSmAd Posted September 25, 2008 Share Posted September 25, 2008 That error literally means that php reached the end of your file while it was still expecting php code. This is usually caused by mismatched {} (it can also be caused by a quoted string that is not closed.) You need to go through your code and make sure there are matching opening and closing {} everywhere you intended them to be. It would help if you started indenting your code so that everything at the same block level was indented so that you could see if all opening { had a corresponding closing }. Link to comment https://forums.phpfreaks.com/topic/125713-quick-error-needs-sorting/#findComment-650031 Share on other sites More sharing options...
rarebit Posted September 25, 2008 Share Posted September 25, 2008 $player->awake = 'not'; echo 'goodnight!'; Link to comment https://forums.phpfreaks.com/topic/125713-quick-error-needs-sorting/#findComment-650034 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.