doubledee Posted April 4, 2011 Share Posted April 4, 2011 I am building an XML string to send to another server. The manual I am going off of says, NOTE: * XML has a special set of characters that cannot be used in normal XML strings. These characters are: Special Character Equivalent & & < < > > " " ' ' It goes on to say... # To avoid problems with special characters, URLEncode special characters (example: ~ ! @ # % ^ &) before sending to the IS Gateway # If you are using POST method, UTF-8 encoding must be used. I am unsure of what to do based on the information above?! It looks like I might want to use urlencode?? Also, maybe I need either htmlentities (or possibly htmlspecialchars)?? Please enlighten me (and help protect my data)!! Thanks, Debbie Link to comment https://forums.phpfreaks.com/topic/232623-making-xml-string-safe/ Share on other sites More sharing options...
requinix Posted April 4, 2011 Share Posted April 4, 2011 Step 1: utf8_encode() but only if your data isn't already in UTF-8. Step 2: htmlspecialchars(). Step 2 may be optional, depending on how you're generating the XML. Link to comment https://forums.phpfreaks.com/topic/232623-making-xml-string-safe/#findComment-1196479 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.