Nasıl mı ben $ _GET doğru Kimliği

0 Cevap php

picture.php

if (!isset($_GET['id'])) {
    header('location:/');
    exit();
} else if (isset($_GET['id'])) {
    print_r($_GET);
}

$ _GET Çıktı

 Array ( [page] => picture ) 

. Htaccess

RewriteEngine On
RewriteBase /
RewriteRule ^([A-Za-z0-9-]+)/?$ /index.php?page=$1 [L]
RewriteRule ^([A-Za-z0-9-]+)/picture/?$ /picture/?id=$1 [L]

URL biçimi: http://local.com/42/picture/

Soru: Nasıl yapmak için $_GET['id'] yazdıracak 42 and not the picture

0 Cevap