如果我想定位特定网站,如何以html格式嵌入http请求?

时间:2016-06-16 04:51:12

标签: php

我想知道,我怎样才能以html格式嵌入像myurl.php这样的http请求网址,然后使用按钮将值推送到服务器上 所以我想放(url.php),但我不希望页面重定向到url 每次我按提交。我只是希望数据到达指定的服务器。 不,我不拥有相关网站。

1 个答案:

答案 0 :(得分:0)

您可以通过ajax使用此示例代码

来执行此操作
$("formId").submit(function(e){
e.preventDefault();
  $.ajax({
     type: "POST",
       url: 'url.php',
       data: $("#formId").serialize(), // serializes the form's elements.
       success: function(data)
       {
           alert(data); // show response from the php script.
       }
  })
});

或者您可以使用Ajax Form plugin