Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [php] unexpected T_CONSTANT_ENCAPSED_STRING
Gallareton
post
Post #1





Grupa: Zarejestrowani
Postów: 143
Pomógł: 0
Dołączył: 11.03.2007
Skąd: Gliwice

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


Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in D:\Program Files\WebServ\httpd\loc\pole.php on line 9 <= Taki blad mi wyskakuje w tym oto skrypcie:
  1. <?php ob_start(); ?>
  2. <center>
  3. <table border="1">
  4. <tr>
  5. <?
  6. $potwory = Array('warchlak', 'knur');
  7. $x=0;
  8. while($x<2) {
  9. echo('<img src="potworypole'."$potwory[$x]".'.jpg" width="200" height="200">');
  10. $x++;
  11. }
  12. ?>
  13. </tr>
  14. </table>
  15. <?php ob_end_flush(); ?>

Wlasciwie to nie rozumiem bledu, wiec czy mzoe mi ktos wytlumaczyc co jest zle?
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
qrees
post
Post #2





Grupa: Zarejestrowani
Postów: 275
Pomógł: 44
Dołączył: 23.11.2007

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


Syntax error, czyli bląd składni. Pomięszałeś gdzieś nawiasy, apostrofy albo coś takiego.

Przyjrzyj się linijce:
  1. <?php
  2. echo('<img src="potworypole'."$potwory[$x]".'.jpg" width="200" height="200">');
  3. ?>
Go to the top of the page
+Quote Post
henio
post
Post #3





Grupa: Zarejestrowani
Postów: 237
Pomógł: 1
Dołączył: 15.10.2004
Skąd: Lublin

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


Cytat(qrees @ 19.01.2008, 12:58:45 ) *
Syntax error, czyli bląd składni. Pomięszałeś gdzieś nawiasy, apostrofy albo coś takiego.

Przyjrzyj się linijce:
  1. <?php
  2. echo('<img src="potworypole'."$potwory[$x]".'.jpg" width="200" height="200">');
  3. ?>

JA BYM TO tak napisał:
  1. <?php
  2. echo "<img src=\"potwprypole".$potwory[$x].".jpg\" width=\"200\" height=\"200\" />";
  3. ?>
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 9.10.2025 - 11:14