Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Closed TopicStart new topic
> Błąd PHP Parse error: syntax error, unexpected T_STRING, expecting ',' or ';'
Corsarz
post 25.08.2007, 12:18:59
Post #1





Grupa: Zarejestrowani
Postów: 14
Pomógł: 0
Dołączył: 9.08.2007

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


bardzo proszę o pomoc z tym kawałkiem kodu, jest on z książki "PHP i MySQL Tworzenie stron WWW", niestety generuje błąd
"PHP Parse error: syntax error, unexpected T_STRING, expecting ',' or ';'"
Przeglądałem juz forum i znalazłem temat, który o tym mówił (postawienie \ przed ") ale w moim przypadku nie zadziałało

A otóz kod:
  1. <?php
  2. $odleglosc = 50;
  3. while ($odleglosc <= 250 )
  4. {
  5. echo "tr>\n <td align="right">$odleglosc</td>\n";
  6. echo "<td align="right">".$odleglosc/10."</td>\n</tr>\n";
  7. $odleglosc +=50;
  8. }
  9. ?>


Ten post edytował Corsarz 25.08.2007, 12:33:24
Go to the top of the page
+Quote Post
phpion
post 25.08.2007, 12:21:33
Post #2





Grupa: Moderatorzy
Postów: 6 072
Pomógł: 861
Dołączył: 10.12.2003
Skąd: Dąbrowa Górnicza




  1. <?php
  2. $odleglosc = 50;
  3. while ($odleglosc <= 250 )
  4. {
  5. echo '<tr><td align="right">'.$odleglosc.'</td>';
  6. echo '<td align="right">'.$odleglosc/10.'</td></tr>';
  7. $odleglosc +=50;
  8. }
  9. ?>
Go to the top of the page
+Quote Post
Cysiaczek
post 25.08.2007, 12:26:43
Post #3





Grupa: Moderatorzy
Postów: 4 465
Pomógł: 137
Dołączył: 26.03.2004
Skąd: Gorzów Wlkp.




1. Postawienie \ przed znakiemi (") lub (') pomaga - nawet w tym wypadku.
2. Użyj bbcode
3. Popraw proszę tytuł topiku na zgodny z zasadami forum Przedszkole

Pozdrawiam.


--------------------
To think for yourself you must question authority and
learn how to put yourself in a state of vulnerable, open-mindedness;
chaotic, confused, vulnerability, to inform yourself.
Think for yourself. Question authority.
Go to the top of the page
+Quote Post
Corsarz
post 25.08.2007, 12:32:49
Post #4





Grupa: Zarejestrowani
Postów: 14
Pomógł: 0
Dołączył: 9.08.2007

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


niestety , ten kod
  1. <?php
  2. $odleglosc = 50;
  3. while ($odleglosc <= 250)
  4. {
  5.  echo '<tr> <td align="right">'.$odleglosc.'</td>';
  6.  echo '<td align="right">'.$odleglosc/10.'</td></tr>'; //tu zglasza blad
  7. $odleglosc +=50;
  8. }
  9. ?>

nadal generuje ten sam błąd, tym razem w linii nizej
Go to the top of the page
+Quote Post
magier123
post 25.08.2007, 12:33:57
Post #5





Grupa: Zarejestrowani
Postów: 80
Pomógł: 0
Dołączył: 27.03.2007

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


SPRAWDZONE biggrin.gif

  1. <?php
  2. $odleglosc = 50;
  3. $a=10;
  4. while ($odleglosc <= 250 )
  5.  
  6. {
  7. echo "<tr>\n <td align='right'>".$odleglosc."</td>\n";
  8. echo "<td align='right'>".$odleglosc/$a."</td>\n</tr>\n";
  9. $odleglosc +=50;
  10. }
  11. ?>
Go to the top of the page
+Quote Post
phpion
post 25.08.2007, 12:36:35
Post #6





Grupa: Moderatorzy
Postów: 6 072
Pomógł: 861
Dołączył: 10.12.2003
Skąd: Dąbrowa Górnicza




W takim razie:
  1. <?php
  2. $odleglosc = 50;
  3. while ($odleglosc <= 250)
  4. {
  5.  echo '<tr> <td align="right">'.$odleglosc.'</td>';
  6.  echo '<td align="right">'.($odleglosc/10).'</td></tr>'; //tu zglasza blad
  7. $odleglosc +=50;
  8. }
  9. ?>

Teraz powinno śmigać.
Go to the top of the page
+Quote Post
Corsarz
post 25.08.2007, 12:38:02
Post #7





Grupa: Zarejestrowani
Postów: 14
Pomógł: 0
Dołączył: 9.08.2007

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


Yeap dzieki działa ^^
Go to the top of the page
+Quote Post
-robenssj4-
post 11.08.2008, 15:45:57
Post #8





Goście







ja mam podobny problem,
<td style=\"background-image: url('"".THEME."img/zdb-v2_16.png'); padding-left: 5px; padding-right: 5px; width: 154px;\">\n";
Go to the top of the page
+Quote Post
zygixxx
post 1.09.2009, 15:28:45
Post #9





Grupa: Zarejestrowani
Postów: 1
Pomógł: 0
Dołączył: 1.09.2009

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


Witam. Czy mógłby mi ktoś pomóc w podobnym problemie?
Niestety co do php jestem zupełną lamką, i nie wiem jak się do tego zabrać.

Parse error: syntax error, unexpected T_STRING in ***********index.php on line 122

Oto te linie:

Kod
'S_LOGIN_ACTION'            => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=login'),
'S_DISPLAY_BIRTHDAY_LIST'    => ($config['load_birthdays']) ? true : false,
'U_MARK_FORUMS'        => ($user->data['is_registered'] || $config['load_anon_lastread']) ? append_sid("{$phpbb_root_path}index.$phpEx",


Z góry dziękuję za wszelką pomoc smile.gif
Pozdrawiam
Marek
Go to the top of the page
+Quote Post
mls
post 1.09.2009, 17:34:37
Post #10





Grupa: Zarejestrowani
Postów: 677
Pomógł: 89
Dołączył: 31.08.2003
Skąd: Warszawa

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


  1. 'U_MARK_FORUMS' => ($user->data['is_registered'] || $config['load_anon_lastread']) ? append_sid("{$phpbb_root_path}index.$phpEx") : "",


--------------------
Go to the top of the page
+Quote Post
Spawnm
post 1.09.2009, 19:56:33
Post #11





Grupa: Moderatorzy
Postów: 4 069
Pomógł: 497
Dołączył: 11.05.2007
Skąd: Warszawa




Forum nie parser, zamykam.
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 Wersja Lo-Fi Aktualny czas: 15.06.2025 - 09:41