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 |
|
|
|
![]() |
Post
#2
|
|
|
Grupa: Zarejestrowani Postów: 339 Pomógł: 12 Dołączył: 22.11.2008 Ostrzeżenie: (20%)
|
W head na index.php, a tamto tam gdzie mają się includować strony (1.inc.php 2.inc.php itd.)
index.php Kod <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="pl" lang="pl"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2" /> <meta name="robots" content="index" /> <meta name="description" content="Tytuł strony" /> <meta name="keywords" content="Słowa kluczowe" /> <link rel="shortcut icon" href="favicon.ico" /> <link rel="stylesheet" type="text/css" href="style.css" /> <title>Untitled</title> <?php header("Location: index.php?site=news"); ?> </head> <body> <p> </p> </body> </html> indeks.inc.php Kod <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="pl" lang="pl"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2" /> <meta name="robots" content="index" /> <meta name="description" content="Tytuł strony" /> <meta name="keywords" content="Słowa kluczowe" /> <link rel="shortcut icon" href="favicon.ico" /> <link rel="stylesheet" type="text/css" href="style.css" /> <title>Untitled</title> </head> <body> <?php if(isset($_GET[ 'site' ])){ $site = htmlspecialchars($_GET['site']) .'.inc.php'; if(file_exists($site )){ include( $site ); }else{ echo 'Strona o podanym adresie nie istnieje.'; // jeśli nie ma strony inaczej 404 } }else{ echo 'Strona główna'; //Domyślnie nie jest index.php?as=asd ale pokazuje sie coś } ?> </body> </html> U mnie to jest tak rozwiązane (IMG:http://forum.php.pl/style_emoticons/default/smile.gif) pozdro Ten post edytował Strarus 8.01.2009, 21:31:03 |
|
|
|
Bladeq123 Index.php?id= 8.01.2009, 21:05:05
Rafal Filipek omg, a mozna jasniej ? bo tak z tego co piszesz to... 8.01.2009, 21:09:43
Bladeq123 Wklejam to gdzie chce zeby mi czytało zak... 8.01.2009, 21:16:59
Rafal Filipek pobaw sie switchem bedzie lepiej 8.01.2009, 21:20:00
Strarus [PHP] pobierz, plaintext <?phpif(isset... 8.01.2009, 21:20:19
Bladeq123 starsus a wiesz jak zrobic zeby strona wchodzila o... 8.01.2009, 21:23:14
Strarus dajesz
[PHP] pobierz, plaintext <?phpheader... 8.01.2009, 21:27:23
Bladeq123 a gdzie to mam wkleić? 8.01.2009, 21:28:18
Bladeq123 Dzieki można zamknąć
Masz Piwko :* 8.01.2009, 21:30:21
Rafal Filipek pomijam bezsensowność tego rozwiązania. dodanie ta... 8.01.2009, 21:33:43
Strarus a no tak sorki @Bladeq123
[PHP] pobierz, plainte... 8.01.2009, 21:36:56
Rafal Filipek Boże, widzisz i nie grzmisz. Powiedzcie mi PO CO R... 8.01.2009, 21:38:47
Strarus w sumie... 8.01.2009, 21:41:56
bartg Bez obrazy, ale jak widze ludzi którzy w PHP może ... 8.01.2009, 22:41:03 ![]() ![]() |
|
Aktualny czas: 29.12.2025 - 12:52 |