So here's what my URL looks like
http://localhost/search/s.php?search_query=#hashtag
My first response to this was to use $_GET
$search = htmlspecialchars($_GET['search_query'], ENT_QUOTES, 'UTF-8');
So I'd then end up getting nothing, since I had a #
at the end. So I then tried
$url = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
$path = parse_url($url, PHP_URL_PATH);
$pathFragments = explode('/', $path);
$id = end($pathFragments);
I'd echo $id
, and yet once again get s.php
instead.
So my question is, how can I properly do this? I've seen some posts. But none seem to solve my issue.
I'm just trying to get #hashtag
.