Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> include w podstronie
tom111
post
Post #1





Grupa: Zarejestrowani
Postów: 3
Pomógł: 0
Dołączył: 21.11.2006

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


Witam. Szukam, kombinuje, ale jakos mi to nie idzie.
Człowiek zielony jest.

za pomoca tego
  1. <a href="index.php?id=onas">O nas</a>


wczytuje strone w tabele w index.php
  1. <td style="vertical-align: top; min-height: 350px;">
  2. <?php if(empty($_GET['id']) or $_GET['id']=="info"){ include("strony/info.html"); } 
  3. if($_GET['id']=="onas"){ include("strony/onas.html"); }
  4. if($_GET['id']=="team"){ include("strony/team.php"); }
  5. ?>


Naprowadzcie mnie co uczynic, żeby dać dalsze odnosniki we wczytanej stronie "strony/team.php"
a one podmieniały ją na dalsze strony w tym samym miejscu - coś jakby ramka.
widziałem takie cuda http://xx.pl/index.php?id=cos&inne=2 ale jak to zrobione jest (IMG:http://forum.php.pl/style_emoticons/default/sadsmiley02.gif)

Dzieki.
Go to the top of the page
+Quote Post
lopik
post
Post #2





Grupa: Zarejestrowani
Postów: 340
Pomógł: 0
Dołączył: 7.07.2006

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


NP:

  1. <?php
  2. switch ($_GET['id']) {
  3.  case 'onas':
  4.  include('strony/onas.html');
  5.  break;
  6.  case 'tesm':
  7.  include('strony/team.html');
  8.  break;
  9.  case 'info':
  10.  include('strony/info.html');
  11.  break;
  12.  
  13. // itd.
  14. }
  15. ?>


Acha, chyba źle zrozumiałem.

Ale w każdym razie switch jest lepsze do tego kodu co tutaj podałeś.

Ten post edytował lopik 21.11.2006, 14:05:11
Go to the top of the page
+Quote Post
dtb
post
Post #3





Grupa: Zarejestrowani
Postów: 476
Pomógł: 1
Dołączył: 5.11.2005
Skąd: Bieruń city

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


tak samo jak kod w index.php, tylko zamiast $_GET['id'] dajesz $_GET['inne']
Go to the top of the page
+Quote Post
tom111
post
Post #4





Grupa: Zarejestrowani
Postów: 3
Pomógł: 0
Dołączył: 21.11.2006

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


Cytat(dtb @ 21.11.2006, 14:54:15 ) *
tak samo jak kod w index.php, tylko zamiast $_GET['id'] dajesz $_GET['inne']



(IMG:http://forum.php.pl/style_emoticons/default/biggrin.gif) zadziałało
zapodałem
  1. <?php include("team.php"); ?>


Połączyłem obie wasze wypowiedzi

  1. <?php
  2. switch ($_GET['team']) {
  3. case "1": $inc = 'strony/team/1.html';
  4. break;
  5. case "2": $inc = 'strony/team/2.html';
  6. break;
  7.  
  8. default: $inc = 'strony/team/0.html';
  9. break;
  10. }
  11. include ($inc);
  12. ?>


o teraz nareszcie cos takiego działa
  1. <a href="index.php?id=team&team=1">



Dziekowac.
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: 22.08.2025 - 23:31