HTML 选择下拉菜单 - 单击提交并根据值转到 URL
我想要做的是有一个 HTML 下拉列表,例如:
<option value="">Select Tire Brand</option>
<option value="cooper">Cooper</option>
<option value="michelin">Michelin</option>
当他们单击“提交”按钮时,我希望它转到 http://www.domain.com/{selection}/
所以如果他们选择 Cooper,它将转到 http://www.domain.com/cooper/。
我会使用 GET 方法并让它转到主 URL,即brand_results.php?brand=cooper,但该 URL 不会显示为我使用 htaccess 的简洁 URL。
有办法做我正在寻找的事情吗?
谢谢你!
What I want to do is have an HTML drop down for example:
<option value="">Select Tire Brand</option>
<option value="cooper">Cooper</option>
<option value="michelin">Michelin</option>
And when they click the Submit button, I want it to go to http://www.domain.com/{selection}/
so if they selected Cooper it would go to http://www.domain.com/cooper/.
I would use the GET method and have it go to the main URL which is brand_results.php?brand=cooper but then the URL wouldn't show up as the neat URL which I use htaccess for.
Is there a way to do what I am looking for?
Thank you!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我假设您的
提交后:
I am assuming the value of name for your
<select>
ismySelect
below.After submission:
在接收结果的文件中:
In the file that receives the result: