| Welcome to WebmasterWorld Guest from 184.108.40.206 |
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
|Become a Pro Member|
|XML message as variable in URL|
XML message as variable in URL
I am writing a PHP script to receive SMS from my SMS gateway.
My SMS gateway uses the following URL to post message to my server.
http://www.yourserver.com/incomingsms.php?xml=<?xml version="1.0" encoding="UTF-8" ?><TRUMPIA> <phonenumber>1234567890</phonenumber> <keyword>keyword</keyword> <contents>contents</contents> </TRUMPIA>
In my incomingsms.php file if I get the value of xml using $_GET["xml"] I am not getting the XML code. I only get 1234567890 keyword contents. It strips all the xml tags.
Since I am developing my php in a generic way, I need to get the whole xml message and I need to identify tag phonenumber to get the phone number and keyword tag to get the value of keyword and so on.
Could someone please help on this?
Are you sure your browser isn't just parsing the data like this, if you view source you may see the tags.
There seem to be an error some where it makes no sense just to post XML as part of an URL.
Can you get the URL directly from your gateway?, so that you can use simpleXML library to import the XML
If you have to keep posting the XML thur the browser can you get the XML feed serialized and encoded?
Did you find a solution for your SMS problem?
All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved