I'm really sorry if i'm annoying you guys but this is my final question in regards to .htaccess tricks
I need wordpress style, 'pretty permalinks'
But It's too confusing for me.
I need, this url http://test.com/?page=test&ID=1
to be http://test.com/test/NAMEFROMDATABASE
How? I know how to get ID=1
by using $_GET['ID']
, but how do I put a value from the database in the url, and read it?
you can not get ID value by $_GET['ID'] directly from this URL : http://test.com/test/NAMEFROMDATABASE.
You can get ID by following below logic.
create link by category name. i.e. if you have category laptop then create link like http://test.com/category/CATNAME
Write rewrite code in htaccess.RewriteRule ^category/(.*)$ categories\.php?CNAME=$2&%{QUERY_STRING} [L]
$catName=$_GET['CNAME']
OR
RewriteRule ^category/(.*)-ID-([0-9]+)$ categories\.php?ID=$2&%{QUERY_STRING} [L]
$catID= $_GET['ID']