0
I have a URL like this: http://localhost/oficina2/home.php? id=12345 I’m simplifying for: http://localhost/oficina2/? 12345
How do I recover this id (12345) on any page?
I tried it like this: $url = $_GET['id'];
But gives its error: Notice: Undefined index: id in C: xampp htdocs oficina2 home.php on line 2
could simply do
http://endereco/oficina.php/12345
already at once and take the value with$_SERVER['PATH_INFO']
(remembering to remove the bars from the string) - Or rename thehome.php
for your default page server name if it is no longer (usuallyindex.html
in Apache) and use$_SERVER['QUERY_STRING']
to get the number.– Bacco