I am trying to send a GET request to " ...:8000/find/alvin/ "
using a Form I created with the html code below
<form method="get"
style="position:absolute;right:0"
rel="search"
action="/find/">
<input type="text"
class=" form-control"
name="value"
placeholder="Search⌕"/>
<button type="submit" class="d-none" >SUBMIT</button>
</form>
,However after typing a name, and hitting the submit button, I am sent to "...:8000/find/?value=alvin/ "
, how would I send a GET request to my desired URL using a form , a input of type text, and a submit button ?
Any help is truly appreciated , thank you for taking the time to read my question
sincerely, hugo shcottss
Placing the form data in a query string is the normal way of passing data using a form.
If you want to change it to use URLs of the style you are using then there are two approaches:
302 Found
status code and a Location
header with the new URL in it(You can use any language you like for this, and some servers have modules which can be configured to do this (e.g. mod_rewrite) without using an actual programming language).
location
so the browser navigates to itEither way, make sure you escape any values you put in the URL so that the user typing characters with special meaning into the form won't cause you any problems.