I have a question. My question title doesn't really describe what I need help with, but it's the same concept. This is what I want to do:
I am creating a search function (not open for other suggestions than the one I am trying to accomplish), and it's using query string. If I search for "Hello", I want my website to redirect to website.com?s=hello, but if there already is one, add it to the url with a &, like this: website.com?page=home&s=hello.
I tried to use this:
if(isset($_GET)) { // Add the string with & before
else { // Add the string with a ? before
I am willing to use jQuery if I have to
More brief explanation: I have a form, it has an input and a submit-button.
<form action="" method="post">
<li><input type="text" placeholder="Username"></li>
<li><input type="submit" value="Search"></li>
</form>
I am aware how to store everything in variables and such, but I am not sure how to add it as a query string to the url. Thank you!