Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP][.htaccess] index.php filtruje incude ..., Problem z przesłaniem $_GET
DREEMus
post
Post #1





Grupa: Zarejestrowani
Postów: 286
Pomógł: 34
Dołączył: 4.09.2008
Skąd: Wrocław

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


.htaccess
Kod
RewriteRule ([^-]+)$ index.php?inc=$1 [L]


index.php
  1. <?php
  2. function dolacz( $plik ) {
  3.      require_once( 'web_' . $plik . '.inc' );
  4.      }
  5. // head i tak dalej
  6. print_r( $_GET );
  7. if( isset( $_GET['inc'] ) ) {
  8.         dolacz( $_GET['inc'] );
  9.         } else {
  10.                 require_once 'web_news.inc';
  11.                 }
  12. // reszta ...
  13. ?>


http://localhost/art -> Array ( [inc] => index.php )
http://localhost/index.php?inc=art -> Array ( [inc] => index.php )


--------------------
Serwer : Acer Aspire 5050 : AMD Turion X2 2x1.9 MHz : 2x2 GB Dual : 250GB + 500 GB USB
Warsztat : Apache v2.2 : PHP v5.2 : MySQL v5.0 : phpMyAdmin v3.4 : phpDesigner v7
Go to the top of the page
+Quote Post

Posty w temacie


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 Aktualny czas: 22.08.2025 - 03:31