I have a problem with $_GET['']. Before applying .htaccess rules on URL every things was working fine, when I clean the URL's with .htaccess file now the echo $_GET['id'] give me this error (Notice: Undefined index: id in C:\wamp64\www\Test\show.php on line 3). The new clean URL's work fine without parameter but when I tried to send parameter it does not send id. I don't Know what to do. I have searched for this problem more then 10 hours but no result.
my .htaccess file content:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^show/([0-9]+)/([0-9a-zA-Z_-]+) show.php?id=$1&name=$2 [NC,L]
the show.php page where I want to display the values from URL
<?php
$myvar = $_GET['id']."<br>";
$myvar1 = $_GET['name'];
echo $myvar;
echo $myvar1;
?>
this URL have no problem (http://localhost/Test/show.php?id=120&name=ahmad)
**but in this url (http://localhost/Test/show/120/ahmad) this error is happening **
Notice: Undefined index: id in C:\wamp64\www\Test\show.php on line 3 Notice: Undefined index: name in C:\wamp64\www\Test\show.php on line 4
I have dis comment the mod_rewrite.os in httpd.conf file as will.
please help me thanks.