I want to pass parameters using $_GET but dont want to use the query form:
showevent.php?event=usa
should be shown in the url instead want
site.com/events/usa
And for profiles:
site.com/username
I want to pass parameters using $_GET but dont want to use the query form:
showevent.php?event=usa
should be shown in the url instead want
site.com/events/usa
And for profiles:
site.com/username
A browser does not know how to format URLs like that. The standard for submitting forms via GET is query strings and that's the only thing your browser can do. Two options:
Submit via normal query strings, then on the server rewrite the URL and redirect the client. E.g.:
header('Location: /events/' . $_GET['event']);
exit;
This has the drawback of requiring two roundtrips to the server each time and the not-rewritten URL may flash briefly in the user's browsers, but it gets you your nice URL in the end.
You may want a combination of both, with 2. being the fallback for non-Javascript clients.