...

View Full Version : Else help [php]



Dfraz
02-25-2008, 05:36 AM
This gives me an error: Parse error: syntax error, unexpected '}' in /home/frazierf/public_html/forum/rep.php on line 37




<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body> <?php require_once("config.php"); ?>
<?php
$reputation = $retreive_from_database;
if ($reputation != 10) {

echo "<img src=\"images/buttons/reputation/prep1.jpg\" alt=\"This user is average.\" width=\"8\" height=\"10\" />";

if($reputation > 11) {

echo "<img src=\"images/buttons/reputation/prep1.jpg\" alt=\"This user is average.\" width=\"8\" height=\"10\" />";


if($reputation > 12) {

echo "<img src=\"images/buttons/reputation/prep1.jpg\" alt=\"This user is average.\" width=\"8\" height=\"10\" />";




}
else {
}
}

else {

}
}else

}
}else
}
}


?>


</body>
</html>



How do I fix it?

rangana
02-25-2008, 05:54 AM
You have extra closing braces. Maybe you wanted like this :

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body> <?php require_once("config.php"); ?>
<?php
$reputation = $retreive_from_database;
if ($reputation != 10) {

echo "<img src=\"images/buttons/reputation/prep1.jpg\" alt=\"This user is average.\" width=\"8\" height=\"10\" />";

if($reputation > 11) {

echo "<img src=\"images/buttons/reputation/prep1.jpg\" alt=\"This user is average.\" width=\"8\" height=\"10\" />";


if($reputation > 12) {

echo "<img src=\"images/buttons/reputation/prep1.jpg\" alt=\"This user is average.\" width=\"8\" height=\"10\" />";




}
else {
}
}

else {

}
else
{}
else
{}

}

?>


</body>
</html>

See if it helps :D



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum