Maxmud Abusari Maxmud Abusari - 11 months ago 47
PHP Question

Php get method data url to filename/id

I have a this page get_cost.php and when URL gets GET method "id" data it will be like this get_cost.php?id=4. So I want to change this url like this what I must do for this in php?


This question already answered many times before. First you must search your question in site. You can do it with RewriteRule. You must use .htaccess code for this. To get this add this code to your .htaccess file.

RewriteEngine On
RewriteRule ^get_cost/([0-9]+)/ get_cost.php?id=$1

If your filename different you can change get_cost from the code.