Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [php] Zmiana katalogu pobieranych plikow, brak rozwiazania...
annsin
post 18.08.2007, 08:13:21
Post #1





Grupa: Zarejestrowani
Postów: 7
Pomógł: 0
Dołączył: 28.07.2005

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


Co zmienic w tym kodzie aby pliki byly pobierane np z podkatalogu "dane"
a nie z katalogu glownego ?
  1. <?
  2. if($page=="") $page="link1";
  3. if(!file_exists($page.".php")) 
  4. {
  5.  include "default.php";
  6. }
  7. else 
  8. {
  9. include_once $page.".php";
  10. }
  11.  
  12. ?>


Ten post edytował annsin 20.08.2007, 13:52:16
Go to the top of the page
+Quote Post
mild
post 18.08.2007, 08:22:16
Post #2





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

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


ekhm...
  1. <?php
  2. include "dane/default.php";
  3. ?>

itd...
Go to the top of the page
+Quote Post
Cysiaczek
post 18.08.2007, 08:23:12
Post #3





Grupa: Moderatorzy
Postów: 4 465
Pomógł: 137
Dołączył: 26.03.2004
Skąd: Gorzów Wlkp.




Popraw proszę tytuł topiku na zgodny z zasadami forum Przedszkole

  1. <?php
  2. if($page=="") "dane/".$page="link1";
  3. if(!file_exists($page.".php")) 
  4. {
  5.  include "dane/default.php";
  6. }
  7. else 
  8. {
  9. include_once $page.".php";
  10. }
  11. ?>


--------------------
To think for yourself you must question authority and
learn how to put yourself in a state of vulnerable, open-mindedness;
chaotic, confused, vulnerability, to inform yourself.
Think for yourself. Question authority.
Go to the top of the page
+Quote Post
annsin
post 20.08.2007, 18:29:10
Post #4





Grupa: Zarejestrowani
Postów: 7
Pomógł: 0
Dołączył: 28.07.2005

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


Cytat(Cysiaczek @ 18.08.2007, 07:23:12 ) *
Popraw proszę tytuł topiku na zgodny z zasadami forum Przedszkole
  1. <?php if($page==&#092;"\") \"dane/\".$page=\"link1\"; if(!file_exists($page.\".php\"))  {  include \"dane/default.php\"; } else  { include_once $page.\".php\"; }?>
Czy oby napewno ten kod jest poprawny ??Linki do tej pory mialem tej postaci
  1. index.php?page=registration...
i dzialaly..Po przerzuceniu plikow do katalogu "dane" linki nie dzialaja....Czy ktos moze mi pomoc questionmark.gif
Go to the top of the page
+Quote Post
FliSs_tCv
post 20.08.2007, 18:35:29
Post #5





Grupa: Zarejestrowani
Postów: 198
Pomógł: 3
Dołączył: 27.02.2007
Skąd: Tczew

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


chcesz poprostu ładowac dane grafiki raz a tresc podstron wymieniac na zasadzie index.php?page=home itp itd ?


--------------------
Go to the top of the page
+Quote Post
annsin
post 20.08.2007, 18:40:13
Post #6





Grupa: Zarejestrowani
Postów: 7
Pomógł: 0
Dołączył: 28.07.2005

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


tak robilem do tej pory...i chce zeby tak pozostalo.
Z jednym wyjatkiem:
chce zeby wszystkie pliki php byly pobierane z podkatalogu..a nie z glownego
Go to the top of the page
+Quote Post
PanGuzol
post 21.08.2007, 12:23:10
Post #7





Grupa: Zarejestrowani
Postów: 353
Pomógł: 50
Dołączył: 28.07.2005
Skąd: Łaziska Górne

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


  1. <?
  2. if($page=="") $page="link1";
  3. if(!file_exists($page.".php")) 
  4. {
  5.  include "dane/default.php";
  6. }
  7. else 
  8. {
  9. include_once "dane/".$page.".php";
  10. }
  11.  
  12. ?>

Powinno działać ;]


--------------------
Sposób na życie? Uśmiech na twarzy :D
"Widzę więcej, wiem więcej, tak to jest mniej więcej"
"NIE kradnij, rząd nielubi konkurencji"
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 Wersja Lo-Fi Aktualny czas: 14.08.2025 - 10:33