<?xml version="1.0"?><rss version="2.0"><channel><title>Comments on Writing Secure PHP - ILoveJackDaniels.com</title><link>http://www.ilovejackdaniels.com/article/writing-secure-php/</link><description>Latest comments on Writing Secure PHP on ILoveJackDaniels.com</description><item><title>Comment on Writing Secure PHP</title><link>http://www.ilovejackdaniels.com/article/writing-secure-php/comments/</link><guid>http://www.ilovejackdaniels.com/article/writing-secure-php/comments/</guid><description>Comment by mohamed rami ( &lt;a href="http://"&gt;http://&lt;/a&gt; )&lt;br /&gt;&lt;br /&gt;Thanks Alot for This Article ,its very&lt;br /&gt;usefull</description></item><item><title>Comment on Writing Secure PHP</title><link>http://www.ilovejackdaniels.com/article/writing-secure-php/comments/</link><guid>http://www.ilovejackdaniels.com/article/writing-secure-php/comments/</guid><description>Comment by Alex Tokar ( &lt;a href="http://www.atokar.net/"&gt;http://www.atokar.net/&lt;/a&gt; )&lt;br /&gt;&lt;br /&gt;Very nice article for new PHP developers.</description></item><item><title>Comment on Writing Secure PHP</title><link>http://www.ilovejackdaniels.com/article/writing-secure-php/comments/</link><guid>http://www.ilovejackdaniels.com/article/writing-secure-php/comments/</guid><description>Comment by techguide ( &lt;a href="http://http://www.devanggandhi.net/"&gt;http://http://www.devanggandhi.net/&lt;/a&gt; )&lt;br /&gt;&lt;br /&gt;I am new to PHP and this was really helpful</description></item><item><title>Comment on Writing Secure PHP</title><link>http://www.ilovejackdaniels.com/article/writing-secure-php/comments/</link><guid>http://www.ilovejackdaniels.com/article/writing-secure-php/comments/</guid><description>Comment by zyber16 ( &lt;a href="http://"&gt;http://&lt;/a&gt; )&lt;br /&gt;&lt;br /&gt;Damn, I had that ' OR 1=1 # hole on my personal website, got it fixed thanks to this article :)</description></item><item><title>Comment on Writing Secure PHP</title><link>http://www.ilovejackdaniels.com/article/writing-secure-php/comments/</link><guid>http://www.ilovejackdaniels.com/article/writing-secure-php/comments/</guid><description>Comment by Adaptiv Media ( &lt;a href=""&gt;&lt;/a&gt; )&lt;br /&gt;&lt;br /&gt;Thanks, the global variables section was a great help. Also grateful for your mod_rewrite article ;o)</description></item><item><title>Comment on Writing Secure PHP</title><link>http://www.ilovejackdaniels.com/article/writing-secure-php/comments/</link><guid>http://www.ilovejackdaniels.com/article/writing-secure-php/comments/</guid><description>Comment by A. ( &lt;a href=""&gt;&lt;/a&gt; )&lt;br /&gt;&lt;br /&gt;Don't forget mysql_real_escape_string(), with it your script is protected against SQL injections. I even use it for session variables, you can never be too sure.&lt;br /&gt;&lt;br /&gt;Great article by the way.</description></item><item><title>Comment on Writing Secure PHP</title><link>http://www.ilovejackdaniels.com/article/writing-secure-php/comments/</link><guid>http://www.ilovejackdaniels.com/article/writing-secure-php/comments/</guid><description>Comment by Scott ( &lt;a href=""&gt;&lt;/a&gt; )&lt;br /&gt;&lt;br /&gt;@#55:&lt;br /&gt;&lt;br /&gt;QUOTED:&lt;br /&gt;What if this is your query:&lt;br /&gt;SELECT * FROM users WHERE id = $_GET['id']&lt;br /&gt;&lt;br /&gt;It doesn't matter if this is escaped with addslashes, mysql_escape_string, mysql_real_escape_string, etc. If you enter &quot;99 or union all select 0,0,0,0,0 from users&quot;, there is no slash to escape. This is a COMMON mistake and I can't believe no one has told you about this! The best method for handling strings may be addslashes or the like, but integers do not require quotations, thus your filtering system does not work.&lt;br /&gt;END QUOTE&lt;br /&gt;&lt;br /&gt;If your query had the single quotes around $_GET[id], you'd still be protected. Just because the data will be an integer, it doesn't mean you can't quote it, right?</description></item><item><title>Comment on Writing Secure PHP</title><link>http://www.ilovejackdaniels.com/article/writing-secure-php/comments/</link><guid>http://www.ilovejackdaniels.com/article/writing-secure-php/comments/</guid><description>Comment by david Graves ( &lt;a href="http://"&gt;http://&lt;/a&gt; )&lt;br /&gt;&lt;br /&gt;This was a great article.  I had an attack just two days ago and this helped me understand the attack and how to defend from it.  I appreciate your taking the time to talk to us and share your knowledge.  &lt;br /&gt;&lt;br /&gt;I still have not located the print button??</description></item><item><title>Comment on Writing Secure PHP</title><link>http://www.ilovejackdaniels.com/article/writing-secure-php/comments/</link><guid>http://www.ilovejackdaniels.com/article/writing-secure-php/comments/</guid><description>Comment by Hex ( &lt;a href=""&gt;&lt;/a&gt; )&lt;br /&gt;&lt;br /&gt;Why mysql_real_escape_string should be used rather than addslasshes: &lt;br /&gt;&lt;br /&gt;http://shiflett.org/blog/2006/jan/addslashes-versus-mysql-real-escape-string</description></item><item><title>Comment on Writing Secure PHP</title><link>http://www.ilovejackdaniels.com/article/writing-secure-php/comments/</link><guid>http://www.ilovejackdaniels.com/article/writing-secure-php/comments/</guid><description>Comment by FiSh ( &lt;a href="http://13337.org"&gt;http://13337.org&lt;/a&gt; )&lt;br /&gt;&lt;br /&gt;I nearly gagged when I saw this:&lt;br /&gt;&lt;br /&gt;&quot;By checking for apostrophes in the items we enter into the database, and removing or neutralising them, we can prevent anyone from running their own SQL code on our database.&quot;&lt;br /&gt;&lt;br /&gt;What if this is your query:&lt;br /&gt;SELECT * FROM users WHERE id = $_GET['id']&lt;br /&gt;&lt;br /&gt;It doesn't matter if this is escaped with addslashes, mysql_escape_string, mysql_real_escape_string, etc. If you enter &quot;99 or union all select 0,0,0,0,0 from users&quot;, there is no slash to escape. This is a COMMON mistake and I can't believe no one has told you about this! The best method for handling strings may be addslashes or the like, but integers do not require quotations, thus your filtering system does not work.</description></item></channel></rss>