Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [PHP]Dynamiczne ładowani stron
Strarus
post 25.12.2008, 16:24:30
Post #1





Grupa: Zarejestrowani
Postów: 339
Pomógł: 12
Dołączył: 22.11.2008

Ostrzeżenie: (20%)
X----


cześć
Jak mogę najlepiej zrobić dynamiczne ładowanie stron? Na razie zrobiłęm tak:
  1. <?php
  2. $site = ($_GET['site']);
  3. if($site == index) {
  4.  include('index.inc.php');
  5.  }
  6. if($site == about) {
  7.  include('about.inc.php');
  8. }
  9. if($site == gallery) {
  10.  include('gallery.inc.php');
  11. }
  12. if($site == other) {
  13.  include('other.inc.php');
  14. }
  15. if($site == tests) {
  16.  include('tests.inc.php');
  17. }
  18. else {
  19.  echo '';
  20. }
  21. ?>

Niestety on nie jest najlepszy biggrin.gif
Go to the top of the page
+Quote Post
skowron-line
post 25.12.2008, 16:36:21
Post #2





Grupa: Zarejestrowani
Postów: 4 340
Pomógł: 542
Dołączył: 15.01.2006
Skąd: Olsztyn/Warszawa

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


np.

  1. <?php
  2. if(isset( $_GET[ 'site' ] )){
  3. $site = htmlspecialchars( $_GET['site'] ) .'.inc.php';
  4. if( file_exists( $site )){
  5. include( $site );
  6. }else{
  7. echo'strona o podanym adresienie istnieje';
  8. }
  9. }else{
  10. include( 'default.inc.php' );
  11. }
  12. ?>


--------------------
I'm so fast that last night I turned off the light switch in my hotel room and was in bed before the room was dark - Muhammad Ali.
Peg jeżeli chcesz uprawiać sex to dzieci muszą wyjść, a jeżeli chcesz żeby był dobry ty też musisz wyjść - Al Bundy.

QueryBuilder, Mootools.net, bbcradio1::MistaJam
http://www.phpbench.com/
Go to the top of the page
+Quote Post
Strarus
post 25.12.2008, 16:44:24
Post #3





Grupa: Zarejestrowani
Postów: 339
Pomógł: 12
Dołączył: 22.11.2008

Ostrzeżenie: (20%)
X----


Dzięki smile.gif
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 - 03:43