Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> funkcja switch
TheRain
post
Post #1





Grupa: Zarejestrowani
Postów: 2
Pomógł: 0
Dołączył: 22.09.2004

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


Witam

Mam maly problem z ta funkcja o co chodzi juz pisze...

jest sobie jakis plik.php a w nim
<?
include "./menu.php";
?>

cat menu.php

<?
switch ($go)
{

case "dzial":

if($cid==home && $in==1 && $ne==0 && file_exists("$strinclocation/home.inc"))
{
include("$strinclocation/home.php");
}

else if($cid==home && $in==1 && $ne==2 && file_exists("$strinclocation/hm2.php"))
{
include("$strinclocation/hm2.php");
}

break;

default:
{
include("$strinclocation/hm1.php");
}
break;
}
?>

i teraz jesli wejde na plik.php mam info o bledach w pliku menu.php

Notice: Use of undefined constant home - assumed 'home' in /www-strona/menu.php on line 8
[php]
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 2)
silent
post
Post #2





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

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


  1. <?
  2. include &#092;"./menu.php\";
  3. ?>
  4.  
  5. cat menu.php
  6.  
  7. <?
  8. switch ($go)
  9. {
  10.  
  11. case &#092;"dzial\":
  12.  
  13. if($cid=='home' && $in==&& $ne==&& file_exists(&#092;"$strinclocation/home.inc\"))
  14. {
  15. include(&#092;"$strinclocation/home.php\");
  16. }
  17.  
  18. else if($cid=='home' && $in==&& $ne==&& file_exists(&#092;"$strinclocation/hm2.php\"))
  19. {
  20. include(&#092;"$strinclocation/hm2.php\");
  21. }
  22.  
  23. break;
  24.  
  25. default:
  26. {
  27. include(&#092;"$strinclocation/hm1.php\");
  28. }
  29. break;
  30. }
  31. ?>

Tekst należy umieszczać między " " albo ' '.
Go to the top of the page
+Quote Post
TheRain
post
Post #3





Grupa: Zarejestrowani
Postów: 2
Pomógł: 0
Dołączył: 22.09.2004

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


Ok dziala dzieki (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)
Go to the top of the page
+Quote Post

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: 24.08.2025 - 10:43