Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SENDING END
- /*
- * post xml data to a smsmedia sms gateway api
- */
- $xml = <<<EOD
- <?xml version="1.0" encoding="UTF-8"?>
- <SENDBATCH user='username' password='password' application='50' reply='EMAIL:dokwii@smsmedia.info'>
- This is from parsed xml
- <SMSLIST>
- <SMS_SEND to='256712087736' uid='1'/>
- <SMS_SEND to='256791040262' uid='2'/>
- <SMS_SEND to='256754819815' uid='3'/>
- <SMS_SEND to='256754819814' uid='4'/>
- </SMSLIST>
- </SENDBATCH>
- EOD;
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_HEADER, 0);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
- //$url = 'smsxml.php';
- //$url = 'http://localhost:10088/travelport_dev/smsxml.php';
- $url = "http://lambda.smsmedia.ug/travelport";
- curl_setopt($ch, CURLOPT_URL, $url);
- curl_setopt($ch, CURLOPT_POST, 1);
- curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: text/xml'));
- //curl_setopt($ch, CURLOPT_POSTFIELDS, "XML=".$xmlcontent."&password=".$password."&etc=etc");
- curl_setopt($ch, CURLOPT_POSTFIELDS, "XML=$xml");
- //curl_setopt($ch, CURLOPT_POSTFIELDS, $xml);
- $content=curl_exec($ch);
- $info = curl_getinfo($ch);
- curl_close($ch);
- RECEIVING END
- //get xml data
- $xml = simplexml_load_file("php://input");
- //instantiate our xml parser
- $xmlparser = new MyXmlParser($xml);
- //get the root attributes
- $root_att = $xmlparser->GetRootAttributes();
- //authenticate this application from the db
- //get phone numbers and uids arrays
- list($phone_no_arr, $uid_arr) = $xmlparser->GetPhoneUid();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement