Normally when I'm making GET requests I do something like this, for example:
Code:
if(isset($_GET['color'])) {
echo $_GET['color'];
//Outputs "blue"
}
What I'd like is for the link to not have to include ?color=blue
, just the ending "blue" without having to make a new folder or file named blue.html
or so. Like Pastebin for example, ending with an identifying string https://pastebin.com/blue
. So for example:
Link: http://example.com/blue
With that link I'd like to be able to get those 4 last letters so that I can initiate a database search for "blue", or any string. PHP, js (with/without jQuery) are the languages I'm comfortable using.
I do realise this is a newb question, but I do not know where to start.