Jump to content

quick error needs sorting.


seany123

Recommended Posts

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

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 }.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.