Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: [php] engine
Forum PHP.pl > Forum > Gotowe rozwiązania
adisoft
ok wie ktos co tutaj moze byc nie tak juz probowalem wszystkiego blink.gif strona mojego autorstwa oto index.php czylis wszystkie funkcje i ustawienia

  1. <?php
  2.  
  3.     $where = $HTTP_GET_VARS['cmd'];
  4.     $where2 = $HTTP_GET_VARS['id'];
  5.     $allowed_values = array
  6.  
  7.      (
  8.             &#092;"1\" => \"1.inc\",
  9.             &#092;"2\" => \"2.inc\",
  10.             &#092;"3\" => \"3.inc\",
  11.             &#092;"4\" => \"4.inc\",
  12.  
  13.      );
  14.  
  15.      if ($allowed_values[$where] != '')
  16.  
  17.      {
  18.  
  19.             include(&#092;"header.inc\");
  20.             include(&#092;"$allowed_values[$where]\");
  21.             if(!empty($allowed_values[$where2]) include(&#092;"$allowed_values[$where2]\");
  22.             include(&#092;"footer.inc\");
  23.  
  24.      }
  25.  
  26.      else
  27.  
  28.      {
  29.  
  30.             include(&#092;"header.inc\");
  31.             include(&#092;"1.inc\");
  32.             include(&#092;"footer.inc\");
  33.  
  34.      }
  35.  
  36. ?>


header.inc >> cala strona wszystkie ustawienia
1.inc >> pierwsza strona
footer.inc >> stopka

po wejsciu

Cytat
Parse error: parse error, unexpected T_INCLUDE in C:\FoxServ\www\test\index.php on line 21

sadsmiley02.gif
revyag
A moze zmien
  1. <?php
  2. include(&#092;"$allowed_values[$where]\");
  3. ?>

na
  1. <?php
  2. include($allowed_values[$where]);
  3. ?>
silent
Brakuje zamknięcia nawiasu od "if"
Vertical
Może powinno być:
  1. <?php
  2. if ($allowed_values[$where] != '')
  3.  
  4.  {
  5.  
  6. include(&#092;"header.inc\");
  7. include(&#092;"$allowed_values[$where]\");
  8. if(!empty($allowed_values[$where2]) include(&#092;"$allowed_values[$where2]\");
  9. include(&#092;"footer.inc\");
  10.  
  11.  else
  12.  
  13.  {
  14.  
  15. include(&#092;"header.inc\");
  16. include(&#092;"1.inc\");
  17. include(&#092;"footer.inc\");
  18.  
  19.  }
  20. }
  21. ?>
czachor
eeeee.. przecież @silent napisał, co jest źle:
  1. <?php
  2. if(!empty($allowed_values[$where2]))
  3. {
  4. include($allowed_values[$where2]);
  5. };
  6. ?>

brakowało zamknięcia nawiasu if()
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2024 Invision Power Services, Inc.