<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xml:base="http://php.dzone.com"  xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dz="http://www.developerzone.com/modules/dz/1.0">
<channel>
 <title>PHP Zone - Comments for &quot;Watch Your POST: Save PHP POST Data as XML&quot;</title>
 <link>http://php.dzone.com/news/watch-your-post-save-php-post-</link>
 <description>Comments for &quot;Watch Your POST: Save PHP POST Data as XML&quot;</description>
 <language>en</language>
<item>
 <title>Thank you for your post Mark</title>
 <link>http://php.dzone.com/news/watch-your-post-save-php-post-#comment-2072</link>
 <description>&lt;!--paging_filter--&gt;&lt;p&gt;Thank you for your post Mark -- my parade continues to see sunshine.&lt;/p&gt;&lt;p&gt;Scrubbing input before inserting into the DB is a given and can be done after the function is run.  I don&#039;t do any DB scrubbing in the function because I currently use the function to write the POST=&amp;gt;XML info to file.&lt;/p&gt;&lt;p&gt;Serializing the data is another option.&lt;/p&gt;&lt;p&gt;This function has worked great for me. Feel free to post your similar article to the PHP Zone! &lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
 <pubDate>Wed, 26 Mar 2008 21:56:51 -0400</pubDate>
 <dc:creator>davidwalsh</dc:creator>
 <guid isPermaLink="false">comment 2072 at http://php.dzone.com</guid>
</item>
<item>
 <title>I hate to rain on your</title>
 <link>http://php.dzone.com/news/watch-your-post-save-php-post-#comment-2068</link>
 <description>&lt;!--paging_filter--&gt;&lt;p&gt;I hate to rain on your parade, but you&#039;ve done a pretty mediocre job of re-inventing a wheel here.&lt;/p&gt;&lt;p&gt;Firstly theres no filtering of user input. If youre going to echo this to the page then you&#039;re opening it up to XSS attacks, if you&#039;re inserting into a database then you need to make sure you&#039;re escaping correctly.&lt;/p&gt;&lt;p&gt;Secondly (and perhaps most importantly), I&#039;m left wondering why you needed to write this function at all? You could have used either the serialize function or JSON encoding (or no doubt a whole slew of existing libraries or code) to do a very similar thing in one line. They would be easier to parse and probably require less storage.&lt;/p&gt;&lt;p&gt;Then there&#039;s the really important point that hoping to parse your XML without enforcing wellformedness is just a nightmare waiting to happen. If you do insist on using XML for this, your reason is that you can parse it with other tools a later date, but with your current schema you&#039;d need to either tokenise or regex it to all buggery for it to be reliable. Plus because you&#039;re not filtering user input theres no certainty that the user won&#039;t have added their own XML. &lt;/p&gt;</description>
 <pubDate>Wed, 26 Mar 2008 21:29:26 -0400</pubDate>
 <dc:creator>fam</dc:creator>
 <guid isPermaLink="false">comment 2068 at http://php.dzone.com</guid>
</item>
<item>
 <title>Not welformed is correct</title>
 <link>http://php.dzone.com/news/watch-your-post-save-php-post-#comment-2064</link>
 <description>&lt;!--paging_filter--&gt;Not welformed is correct Ian, but I&#039;m more concerned with being able to parse the data in an easy manner later on.  I can write something or find a tool that can easily parse this.</description>
 <pubDate>Wed, 26 Mar 2008 17:09:46 -0400</pubDate>
 <dc:creator>davidwalsh</dc:creator>
 <guid isPermaLink="false">comment 2064 at http://php.dzone.com</guid>
</item>
<item>
 <title>This is an interesting</title>
 <link>http://php.dzone.com/news/watch-your-post-save-php-post-#comment-2062</link>
 <description>&lt;!--paging_filter--&gt;&lt;p&gt;This is an interesting concept, but the XML it generates may not be well-formed.&lt;/p&gt;&lt;p&gt;In the section shown below, the child elements have numeric names, but the first character of an XML element must be either an alpha char, a colon, or an underscore. &lt;/p&gt;&lt;pre class=&quot;xml&quot;&gt;     &amp;lt;languages&amp;gt;  &lt;br /&gt;         &amp;lt;0&amp;gt;php&amp;lt;/0&amp;gt;  &lt;br /&gt;         &amp;lt;1&amp;gt;javascript&amp;lt;/1&amp;gt;  &lt;br /&gt;         &amp;lt;2&amp;gt;java&amp;lt;/2&amp;gt;  &lt;br /&gt;         &amp;lt;3&amp;gt;css&amp;lt;/3&amp;gt;  &lt;br /&gt;     &amp;lt;/languages&amp;gt;  &lt;/pre&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
 <pubDate>Wed, 26 Mar 2008 16:59:35 -0400</pubDate>
 <dc:creator>isnoop</dc:creator>
 <guid isPermaLink="false">comment 2062 at http://php.dzone.com</guid>
</item>
</channel>
</rss>
