Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Problem z pętla for w instrukcji Switch !
radeksnara
post 28.01.2007, 10:35:38
Post #1





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

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


  1. <?php
  2. $adres=$_SERVER['REQUEST_URI'];
  3. $adres=explode('/',$adres);
  4. $adres=array_reverse($adres);
  5. $dozwolone=array('news','last_cw','wpisz_cw','wpisz_news');
  6. $count=count($dozwolone);
  7. switch ($adres[0]) {}
  8. for ($i=1;$i<$count;$i++)
  9. {
  10. case index.php?menu=$dozwolone[$i]&&wyloguj=1:
  11.  $adresik=explode('&',$adres[0]);
  12.  $adres=$adresik[0];
  13.  break;
  14. }
  15.  
  16. case index.php:
  17.  $adres='index.php?menu=news';  
  18.  break;
  19. default
  20.  $adres=$adres[0];  
  21. }
  22. ?>

Kod ten mi nie dziala wywala error !

Parse error: syntax error, unexpected T_CASE in c:\usr\krasnal\www\user\Kopiafunkcje.php on line 12!
12 linia (case index.php?menu=$dozwolone[$i]&&wyloguj=1:)
Gdzie jest tu blad ?
Pozdrawiam !

Ten post edytował radeksnara 28.01.2007, 10:39:27
Go to the top of the page
+Quote Post

Posty w temacie


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 Wersja Lo-Fi Aktualny czas: 14.08.2025 - 06:39