Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Index.php?id=
Bladeq123
post
Post #1





Grupa: Zarejestrowani
Postów: 17
Pomógł: 0
Dołączył: 25.12.2008

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


Witam, mam pytanie jak zrobić że jak wejdę na stronę to żeby czytało od razu np. index.php?id=news
a nie sam index.php

Ten post edytował Bladeq123 8.01.2009, 21:06:56
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
Strarus
post
Post #2





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

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


  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 adresie nie istnieje.';  // jeśli nie ma strony inaczej 404
  8. }
  9. }else{
  10. echo 'Strona główna'; //Domyślnie nie jest index.php?as=asd ale pokazuje sie coś
  11. }
  12. ?>


Sam korzystam (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)
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: 26.12.2025 - 16:47