我想创建一个包含2个输入的页面。用户在输入中输入“John”和“Smith”,然后单击“提交”。
我希望提交的行为类似于http://www.example.com/Smith/John
的链接这可能吗?
答案 0 :(得分:2)
在最基本的层面上,您可以使用header()
函数和表单提交中的get / post变量,如下所示:
header('Location: http://www.example.com/'.$_POST["input1"].'/'.$_POST["input2"]);
这会在提交时将用户重定向到http://www.example.com/Smith/John。