2013-08-01 48 views

回答

2

我认为你在寻找这样的事情:PHP Redirect with POST data

您将需要第二个页面,该职位数据提交到一个完全不同的URL。

-3

你可以用的document.ready功能

$.post({ 
     url: "you_page.php", 
     type: "POST", 
     data:{formId:form_id}, 
     success: function (data){ 
     } 
}); 
-2

使用您将需要两个页面:一个页面输入时会被重定向输入到外部URL的第二页。因为你的代码看起来像这样:

page1: 

<form method="post" action="./page2.php"> 

<input type="hidden" name="somedata" value="yourData"> 

<input type="submit" name="submit" /> 

</form> 


page2: 
//you can create an array contains your posted data 
//if you are dealing with multiple values 
$array = array("somedata"=>$_POST['somedata']); 

//create a url variable that will store all values 
//since you are going to send them as part of a single url 
$url=""; 

//if you are posting more than one value you will need to loop 
//through each one - not necessary if you are sending a single value 

foreach($array as $key=>$value){ 

    $url .=$key."=".urlencode($value)."&"; 
} 

header("http://www.example.com/catchPostData.php?$url"); 
+0

谢谢你的回答,但一切都是这样的:1.按钮在第一页上单击 - >按钮执行功能,收集所需数据 - >通过POST发送数据时没有任何形式 - >外部页面捕获数据并使用它们来填充一些字段 – bbbb

+0

它好吗...高兴地帮助 – awsmketchup

相关问题