I have two questions.
In my webpage (developed by me), I use the GET method to return for example the id of one record that I have in a mySQL database.
For example, one url can be this:
http://www.example.com/example.php?id=1
But in MediaWiki software, they can use this GET method, or one strange method that I don't know, that works like this:
http://www.example.com/example.php/1
How can I do that my PHP script knows that what the id is 1?
And now I have another question. In MediaWiki software, you can do that the index.php file converts to a virtual wiki directory.
Now the final question is: How can I do that in my webpage, the url for this request to my mySQL database (with a PHP script) is:
http://www.example.com/example/1
Thanks.
P.D: Sorry about my bad English. I'm still learning, because I'm from Spain and in Spain the Enslish is not an official language.
In GET method we can not send large amount of data rather limited data is sent because the request parameter is appended into the URL. In POST method large amount of data can be sent because the request parameter is appended into the body.
$_GET is an array of variables passed to the current script via the URL parameters. $_POST is an array of variables passed to the current script via the HTTP POST method.
You can do that with rewrites (e.g. via .htaccess)
Have a look at this page: http://www.workingwith.me.uk/articles/scripting/mod_rewrite
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With