Is it possible to redirect someone to a new page based on their input in a form? Basically, on this statistics web app, when someone enters in a username into the search box and hits submit, I’d like them to be sent do domain.com/username_input (Essentially, the form is only being used to allow someone to enter the username, it’s not getting sent anywhere).
Not sure if this is possible in HTML+PHP or if it would be best done with JavaScript (that is if it is possible at all)
I feel like javascript redirecting or changing the header location is a bit iffy. In this case, changing the header location wouldn’t work anyways.
I tried:
<input id="submit" value="Submit" type="submit" onclick="window.location = window.location + '/' + string.value; return false;"/>
But I get sent to domain.com/?string=form_input
javascript with a redirect on the submit button would work.