Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Closed TopicStart new topic
> [PHP] Błąd przy wyświetlaniu strony, Parse error: syntax error, unexpected '='
Kubik213
post
Post #1





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

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


Witam, pomóżcie:
Kawałek kodu, w którym jest błąd:

Cytat
Parse error: syntax error, unexpected '=' [...] on line 124


Cytat
<?
$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>
";

}
?>


124 linijka to: <table border=\"1\" style=\"width:80%;\" class=\"barabara\"><tr>
Go to the top of the page
+Quote Post
piotrooo89
post
Post #2


Newsman


Grupa: Moderatorzy
Postów: 4 005
Pomógł: 548
Dołączył: 7.04.2008
Skąd: Trzebinia/Kraków




co robi tam ten ';' ?


--------------------
Go to the top of the page
+Quote Post
Fifi209
post
Post #3





Grupa: Zarejestrowani
Postów: 4 655
Pomógł: 556
Dołączył: 17.03.2009
Skąd: Katowice

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


Wszystko jasne chyba:

Kod
print"


Daj tam np. :
Kod
echo "


lub (jak wolisz wolniejszy print)
Kod
print("


I na końcu:
(dla print)
Kod
");


--------------------
Zainteresowania: C#, PHP, JS, SQL, AJAX, XML, C dla AVR
Chętnie pomogę, lecz zanim napiszesz: Wujek Google , Manual PHP
Go to the top of the page
+Quote Post
batman
post
Post #4





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




1. Crossposting.
2. Robienie z ludzi walidatorów. Od czego masz edytory z kolorowaniem składni i wskazywaniem błędów.

Zamykam.

Jeszcze raz założysz temat o tym samym, to dostaniesz warna.


--------------------
I would love to change the world, but they won't give me the source code.
My software never has bugs. It just develops random features.
Go to the top of the page
+Quote Post

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

 



RSS Aktualny czas: 21.08.2025 - 20:32