donmqryh49993
donmqryh49993
2018-06-28 13:13

使用jquery在表单提交上添加post变量值

  • php
  • javascript
  • jquery

I have to send some POST variables with values when submitting the form. I have to send variable_1 and variable_2

In result.php I need to get the value of $_POST['variable_1'] and $_POST['variable_2']. How can I do this?

<form action="result.php" method="post">      
  <input type="submit" name="submit">
</form>
$('form').submit(function () { 
  var variable_1 = "test";
  var varible_2 = "test2";       
});

Please help.

  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

3条回答