Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP]niedzialajacy skrypt menu
--emia--
post
Post #1





Goście







witam,mam troche głupi problem, nie uruchamia mi się prawidłowo skrypt menu, ze strony indexu,który wygląda tak:
  1. <?php
  2. $go = $_GET['go'];
  3. if(!empty($go)) {
  4. if(is_file('$go.php')) include ($go.php');
  5. else echo "<br />Nie ma takiej strony";
  6. }
  7. else include ('1.php);
  8. ?>

a w menu jest taki:
  1. <?php
  2. <a href="index.php">strona główna</a><br />
  3. <a href="index.php?go=2">Galeria</a><br />
  4. <a href="index.php?go=2">o nas</a><br />
  5. <a href="index.php?go=2">kontakt</a>
  6. ?>


przy wyświetlaniu z index.php pojawia się 1.php ale na linki pozostale nie ma reakcji(z wyj. strony glównej) .gdzie jest błąd?(IMG:http://forum.php.pl/style_emoticons/default/questionmark.gif)
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
Zac
post
Post #2





Grupa: Zarejestrowani
Postów: 27
Pomógł: 2
Dołączył: 9.06.2008

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


jak dla mnie powinno byc tak:
  1. <?php
  2. $go = $_GET['go'];
  3. if(!empty($go)) {
  4. if(is_file($go.'.php')) include ($go.'.php');
  5. else echo "<br />Nie ma takiej strony";
  6. }
  7. else include ('1.php');
  8. ?>
Go to the top of the page
+Quote Post
drPayton
post
Post #3





Grupa: Zarejestrowani
Postów: 890
Pomógł: 65
Dołączył: 13.11.2005
Skąd: Olsztyn

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


Cytat(Zac @ 8.10.2008, 08:24:03 ) *
jak dla mnie powinno byc tak:
(...)

Tzn nie powinno, ale działać będzie (IMG:http://forum.php.pl/style_emoticons/default/winksmiley.jpg)
Go to the top of the page
+Quote Post
phpion
post
Post #4





Grupa: Moderatorzy
Postów: 6 072
Pomógł: 861
Dołączył: 10.12.2003
Skąd: Dąbrowa Górnicza




Cytat(drPayton @ 8.10.2008, 08:47:32 ) *
Tzn nie powinno, ale działać będzie (IMG:http://forum.php.pl/style_emoticons/default/winksmiley.jpg)

A dlaczego nie powinno? Wpisz sobie w adresie przeglądarki: index.php?go=index (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)
Go to the top of the page
+Quote Post
drPayton
post
Post #5





Grupa: Zarejestrowani
Postów: 890
Pomógł: 65
Dołączył: 13.11.2005
Skąd: Olsztyn

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


Cytat(phpion @ 8.10.2008, 08:50:44 ) *
A dlaczego nie powinno? Wpisz sobie w adresie przeglądarki: index.php?go=index (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)

A to już w ogóle ekstremum (IMG:http://forum.php.pl/style_emoticons/default/haha.gif)

Ten post edytował drPayton 8.10.2008, 07:52:44
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 - 17:05