Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Problem z kodem PHP, "syntax error, unexpected '='"
Kubik213
post
Post #1





Grupa: Zarejestrowani
Postów: 8
Pomógł: 0
Dołączył: 25.04.2009

Ostrzeżenie: (0%)
-----


Witam, co w tym kodzie jest źle ;/ bo występuje błąd:


Cytat
Parse error: syntax error, unexpected '=' in D:\xampp\htdocs\accmaker\layouts\metin\layout.php on line 124

błąd przypada na linijke: <table border=\"1\" style=\"width:80%;\" class=\"barabara\"><tr>

Cytat
<?PHP
$limit = 1;
function coloured_value($valuein)
{
$value2 = $valuein;
while(strlen($value2) > 3)
{
$value .= '.'.substr($value2, -3, 3);
$value2 = substr($value2, 0, strlen($value2)-3);
}
$value = $value2.$value;
if($valuein > 0)
return '<font color="green">+'.$value.'</font>';
elseif($valuein < 0)
return '<font color="red">-'.$value.'</font>';
else
return ''.$value.'';

}
if(empty($type))
$players = $SQL->query(' SELECT * FROM players ORDER BY `players`.`experience`-`players`.`exphist_lastexp` DESC LIMIT '.$limit)->fetchAll();
foreach($players as $player)
{

print"
<table border=\"1\" style=\"width:80%;\" class=\"barabara\"><tr>
<td><a href="?subtopic=characters&name='.urlencode($player['name']).'"><font color="red" size="1"><b>'.$player['name'].'</font></b></a><br /><font color="#CCFF99"

size="1">'.$player['level'].' '.$config_vocations[$player['vocation']].'</font></td>
<td align="right"><font color="#CCFF99" size="1">'.coloured_value($player['experience'] - $player['exphist_lastexp']).'</font></tr></td>
</td></table>
";

}
?>
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
batman
post
Post #2





Grupa: Moderatorzy
Postów: 2 921
Pomógł: 269
Dołączył: 11.08.2005
Skąd: 127.0.0.1




Ludzie. Forum to nie jest wykrywacz błędów. Zainstaluj sobie dowolny edytor z kolorowaniem i sprawdzaniem składni i będziesz wiedział gdzie masz błąd.
Zamykam.
Go to the top of the page
+Quote Post

Posty w temacie


Closed TopicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 2.10.2025 - 20:21