Reputation: 148
lets say i have a link like that
d8ed54 is the id
How i can use $_GET to echo the id
Thank you
Update........
Not possible in my case to use .htaccess RewriteRule because it's already have a one for all the script links..i can't play on it.
However the link http://www.example.com/d8ed54 will work without 404
I need something with php
Upvotes: 0
Views: 638
Reputation: 6333
Without using mod_rewrite Apache (Assuming you use Apache) will look for a file or directory named d8ed54. I'm afraid it cannot be done without mod_rewrite.
Upvotes: 0
Reputation: 21003
put the following in htaccess
RewriteRule (.*) index.php?id=$1
and then you can use $_GET['id']
to get whatever is passed after the /
you can also do this without $_GET and without any extra additions to your htaccess, you can use $_SERVER['REQUEST_URI']
to get the same piece of information.
$id = $_SERVER['REQUEST_URI'];
Upvotes: 2