如何将表单输入附加到url并调用该url


How to append form inputs to a url and call that url?

我有一个url,我希望用户填写表单并提交表单,然后提交操作应该将各种输入附加到该url并重定向页面。我是jquery新手,我觉得这不会有什么帮助,我也不太了解

您可以使用表单方法作为get,所有值将被附加到url

开始
<form method="get" action="page2.php">
  <input type="text" name="one">
  <input type="text" name="two">
  <input type="submit" value="Submit">
</form>
//page2.php
<?php
  $one = $_GET[ 'one' ];
  $two = $_GET[ 'two' ];
?>

您将注意到,当您提交表单时,两个输入的值可以在url中看到。