2010-10-26 2 views
0

J'ai un contrôleur Joomla qui répète un certain nombre de fois sur du code XML Google Checkout. Ce que je veux, c'est pendant cette itération, POST des données à une autre page - dans le même site.POST de données vers une autre page Joomla sur le même site

si

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 

Le contrôleur iterator.php afficherons données à executor.php peut-être 2 ou même 50 fois.

Comment est-ce que je peux faire ceci?

Répondre

1

Pour publier des données sur une page en php, vous pouvez utiliser l'extension de cURL

0

Un moyen rapide et sale peut être comme ça ..

$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); 
Questions connexes