2010-10-26 31 views
0

我有一個Joomla控制器,它在一些Google Checkout XML代碼上迭代多次。我想要的是在此迭代過程中,將數據發佈到另一個頁面 - 在同一個站點中。將數據POST到同一網站上的另一個Joomla頁面

所以

com_mycomponent/controllers/checkout_iterator.php //breaks up the xml into small parts and posts then to the executor, one at a time 
com_mycomponent/controllers/checkout_executor.php //does the real work for each XML element it is passed 

的iterator.php控制器將數據發佈到executor.php也許2或甚至50倍。

我該怎麼做?

回答

1

上傳數據到PHP頁面中,您可以使用cURL擴展

0

一個快速和骯髒的方式,可能是這樣的..

$c = curl_init(); 
curl_setopt($c, CURLOPT_URL, 'com_mycomponent/controllers/checkout_executor.php'); 
curl_setopt($c, CURLOPT_HEADER, false); 
curl_setopt($c, CURLOPT_POST, true); 

// send data 
curl_setopt($c, CURLOPT_POSTFIELDS, 'a=1&b=2..'); 
curl_exec($c); 
// other data.. we can use same handle 
curl_setopt($c, CURLOPT_POSTFIELDS, 'a=1&b=2..'); 
curl_exec($c); 

// don't forget to close 
curl_close($c); 
相關問題