Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [php] engine
adisoft
post
Post #1





Grupa: Zarejestrowani
Postów: 92
Pomógł: 0
Dołączył: 24.01.2004
Skąd: Witten Zentrum <==> Chorzów Batory

Ostrzeżenie: (10%)
X----


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

Ten post edytował adisoft 1.10.2004, 12:01:11


--------------------

-=NaTuRaL BoRn KiLaZz=- Clan
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 4)
revyag
post
Post #2





Grupa: Przyjaciele php.pl
Postów: 2 258
Pomógł: 16
Dołączył: 21.09.2004
Skąd: Kielce

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


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

na
  1. <?php
  2. include($allowed_values[$where]);
  3. ?>


--------------------
-------------

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





Grupa: Zarejestrowani
Postów: 127
Pomógł: 0
Dołączył: 18.08.2004
Skąd: Jastrzębie Zdrój

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


Brakuje zamknięcia nawiasu od "if"
Go to the top of the page
+Quote Post
Vertical
post
Post #4





Grupa: Zarejestrowani
Postów: 848
Pomógł: 0
Dołączył: 7.07.2004
Skąd: Wrocław

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


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. ?>
Go to the top of the page
+Quote Post
czachor
post
Post #5





Grupa: Zarejestrowani
Postów: 897
Pomógł: 40
Dołączył: 16.12.2003
Skąd: Warszawa

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


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()


--------------------
how many SEO experts does it take to change a light bulb,lightbulb,light,bulb,lamp,lighting,switch,sex,xxx
5-Reasons-why-you-should-NEVER-fix-a-computer-for-free
Go to the top of the page
+Quote Post

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

 



RSS Aktualny czas: 22.08.2025 - 08:04