[英]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. PS:我是IT中学二年级的学生,这与我们到目前为止所学的完全不同,我只是热衷于解决这种形式。
I managed to do:
我设法做到了:
I created a form which is consisted of two text inputs. 我创建了一个包含两个文本输入的表单。 The user would type in
(example) 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
我准备了地方1-地方5
I need help with :
我需要以下方面的帮助:
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. 然后,它决定哪个页面适合用户键入的内容,例如,用户在“场所1”和“场所5”中键入的内容,在他单击“提交”按钮后,将其重定向到一个网站,该网站显示有关他可以从中访问的信息将位置1放置到位置5。我不在乎他获得的信息,我只是对如何创建可将用户相应地重定向到他所输入内容的内容感兴趣。
The code is in here:
代码在这里:
https://github.com/lukasbryla/FORM-PROBLEM https://github.com/lukasbryla/FORM-PROBLEM
Many thanks in advance ♥ 预先感谢♥
This is pretty simple if you are using php. 如果您使用的是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. 查看该页面末尾的GET方法,这可能是最简单的方法。
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. 如果您不能使用PHP,则可以使用GET方法使用javascript做类似的事情。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.