2013-08-01 43 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

相關問題