how to get xml from openmarket

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
paul_gardelo
Forum Newbie
Posts: 1
Joined: Thu May 13, 2010 3:06 pm

how to get xml from openmarket

Post by paul_gardelo »

I want to integrate open market into my website.I have this dummy code from open market integration guide.

Code: Select all

require_once("SMS.php"); $sms = new SMS();
// PHP "magic quotes" option will add slashes to FORM params
// which will cause a parsing error -- slashes need removed first
if (get_magic_quotes_gpc()) { $xml = stripslashes($_POST['xml']); } else { $xml = $_POST['xml']; }
// parse incoming xml and check if its a deliver request if ($sms->parse($xml) && $sms->isDeliver()) { echo "User Agent: " . $sms->getUserAgent() . "
\n"; echo "Ticket Id: " . $sms->getTicketId() . "
\n"; $source = $sms->getSourceAddr(); echo "Source Type: " . $source->getType() . "
\n"; echo "Source Address: " . $source->getAddress() . "
\n"; $dest = $sms->getDestinationAddr(); echo "Dest Type: " . $dest->getType() . "
\n"; echo "Dest Address: " . $dest->getAddress() . "
\n"; echo "Message Text: " . $sms->getMessageText() . "
\n"; } else { // handle invalid message } 

but i don't know how i will capture sent xml to me by openmarket and parse that.

Here is scenerio.

1. I will send a sms using open market to my customer.

2. They will reply with Yes or No.

3. On the basis of their reply if yes is received I will send them more message otherwise no message will be send further.
Post Reply