简体   繁体   中英

How do I make form (two inputs) take me to another page which selections depends on the input

I would greatly appreciate any help as Im unable to solve my problem. Im grateful for any comment on what tech or backend stuff do i learn for this to work or simply for anything that moves me forward.

Thanks in advance !
PS: Im second grade IT high school student, this is different lvl than we have learned so far and im just keen on solving this form.

I created a form which is consisted of two text inputs. The user would type in place1 (place where he beggins) and place2 (place where he wanna go). place1(他开始乞讨的地方)和place2(他想去的地方)。 It would autocomplete what is he writting and this would be the only valid inputs. I prepared Place 1 - Place 5

Then it decides which page would be adequate to what the user typed in, for example user typed in Place 1 and Place 5, after he clicks the submit button he is redirected to a site which displays information on what he can visit on his way from Place 1 to Place 5. I dont care about the information he gets, im interested only in how do I create something that redirects the user accordingly on what he typed in.


https://github.com/lukasbryla/FORM-PROBLEM

Many thanks in advance ♥

This is pretty simple if you are using php. There is an excellent example on this site , along with other helpful info.

Look into the GET method towards the end of that page, that is probably the simplest for this.

I would suggest that instead of redirecting the user according to their choices, you would have the form send the used to a results page that will have content generated by their choices.

If you can't use PHP, you can do a similar sort of thing with javascript using the GET method.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM