PHP Multi XML POST with loop using CURL

Muhannad

New Member
I have multiple \[code\]XML_PAYLOAD\[/code\]'s to post (different xml posts for each while loop). When I run the loop it will only \[code\]POST\[/code\] the data of the first \[code\]$i\[/code\] loop. How can I get it to \[code\]POST\[/code\] new data for each \[code\]$i\[/code\] loop?\[code\]$i = 0;while ($i < $num) {...datadefine("XML_PAYLOAD", "<?xml stuff and tags?>");define("XML_POST_URL", "http://theurl");$ch = curl_init();curl_setopt($ch, CURLOPT_URL, XML_POST_URL);curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);curl_setopt($ch, CURLOPT_TIMEOUT, 30);curl_setopt($ch, CURLOPT_POSTFIELDS, XML_PAYLOAD);$result = curl_exec($ch);curl_close($ch);$i++;}\[/code\]
 
Back
Top