<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: PHP Security and SQL Injection?</title>
	<atom:link href="http://phparmor.com/php-source-code/php-security-and-sql-injection/feed/" rel="self" type="application/rss+xml" />
	<link>http://phparmor.com/php-source-code/php-security-and-sql-injection/</link>
	<description>php source code protection</description>
	<lastBuildDate>Wed, 08 Sep 2010 08:05:11 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: shabbirbhimani</title>
		<link>http://phparmor.com/php-source-code/php-security-and-sql-injection/comment-page-1/#comment-3911</link>
		<dc:creator>shabbirbhimani</dc:creator>
		<pubDate>Sat, 20 Mar 2010 17:07:58 +0000</pubDate>
		<guid isPermaLink="false">http://phparmor.com/php-source-code/php-security-and-sql-injection/#comment-3911</guid>
		<description>Before going into the details of preventing the SQL you should know how the hackers go about injecting the SQL and take the data / table name out without knowing much about your database schema and I found this wonderful article about it

http://www.go4expert.com/forums/showthread.php?t=11841

It shows you how you can get almost every aspect of data from the database and knowing this helps you protect yourself. I have been checking out my other sites now.

Thanks
Shabbir

http://www.go4expert.com/</description>
		<content:encoded><![CDATA[<p>Before going into the details of preventing the SQL you should know how the hackers go about injecting the SQL and take the data / table name out without knowing much about your database schema and I found this wonderful article about it</p>
<p><a href="http://www.go4expert.com/forums/showthread.php?t=11841" rel="nofollow">http://www.go4expert.com/forums/showthread.php?t=11841</a></p>
<p>It shows you how you can get almost every aspect of data from the database and knowing this helps you protect yourself. I have been checking out my other sites now.</p>
<p>Thanks<br />
Shabbir</p>
<p><a href="http://www.go4expert.com/" rel="nofollow">http://www.go4expert.com/</a>
<p>
				<span id="reportcomment_results_div_3911"><a href="javascript:void(0);" onclick="reportComment_AddTextArea( 3911 );" title="Report this comment" rel="nofollow">Report this comment</a></span><br />
				<span id="reportcomment_comment_div_3911"></span>
			</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: coffeeaddict_uk</title>
		<link>http://phparmor.com/php-source-code/php-security-and-sql-injection/comment-page-1/#comment-3910</link>
		<dc:creator>coffeeaddict_uk</dc:creator>
		<pubDate>Sat, 20 Mar 2010 16:11:18 +0000</pubDate>
		<guid isPermaLink="false">http://phparmor.com/php-source-code/php-security-and-sql-injection/#comment-3910</guid>
		<description>What Greigmcl said is right..but just to add, you should &#039;idiot proof&#039; your scripts by validating ANY user input data you recieve BEFORE you put it into a query. If the data is a number, use is_numeric() function on it to check it. If it isnt, then reject it.
If a string is only supposed to have certain characters in, check it only contains those characters using preg_match() or preg_match_all().

http://uk3.php.net/mysql_real_escape_string</description>
		<content:encoded><![CDATA[<p>What Greigmcl said is right..but just to add, you should &#8216;idiot proof&#8217; your scripts by validating ANY user input data you recieve BEFORE you put it into a query. If the data is a number, use is_numeric() function on it to check it. If it isnt, then reject it.<br />
If a string is only supposed to have certain characters in, check it only contains those characters using preg_match() or preg_match_all().</p>
<p><a href="http://uk3.php.net/mysql_real_escape_string" rel="nofollow">http://uk3.php.net/mysql_real_escape_string</a>
<p>
				<span id="reportcomment_results_div_3910"><a href="javascript:void(0);" onclick="reportComment_AddTextArea( 3910 );" title="Report this comment" rel="nofollow">Report this comment</a></span><br />
				<span id="reportcomment_comment_div_3910"></span>
			</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: greigmcl</title>
		<link>http://phparmor.com/php-source-code/php-security-and-sql-injection/comment-page-1/#comment-3909</link>
		<dc:creator>greigmcl</dc:creator>
		<pubDate>Sat, 20 Mar 2010 15:06:16 +0000</pubDate>
		<guid isPermaLink="false">http://phparmor.com/php-source-code/php-security-and-sql-injection/#comment-3909</guid>
		<description>SQL injection attacks have two objectives. The first is to terminate your sql query and run its own query and the second is to twist you query to give the attacker what he wants.  The length of the field being queried/updated is irrelevant, a varchar(10) doesn&#039;t give you only 10 characters to attack in because I can rewrite your form in a couple of minutes and once I close out your query I can put in whatever I want.

Generally what you need to do is prevent the user from ending your query or messing with it in some way and the function mysql_real_escape_string() was designed to do that. The function&#039;s page also has some notes on sql injection and safeguarding queries.

http://uk3.php.net/mysql_real_escape_string</description>
		<content:encoded><![CDATA[<p>SQL injection attacks have two objectives. The first is to terminate your sql query and run its own query and the second is to twist you query to give the attacker what he wants.  The length of the field being queried/updated is irrelevant, a varchar(10) doesn&#8217;t give you only 10 characters to attack in because I can rewrite your form in a couple of minutes and once I close out your query I can put in whatever I want.</p>
<p>Generally what you need to do is prevent the user from ending your query or messing with it in some way and the function mysql_real_escape_string() was designed to do that. The function&#8217;s page also has some notes on sql injection and safeguarding queries.</p>
<p><a href="http://uk3.php.net/mysql_real_escape_string" rel="nofollow">http://uk3.php.net/mysql_real_escape_string</a>
<p>
				<span id="reportcomment_results_div_3909"><a href="javascript:void(0);" onclick="reportComment_AddTextArea( 3909 );" title="Report this comment" rel="nofollow">Report this comment</a></span><br />
				<span id="reportcomment_comment_div_3909"></span>
			</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: drewangell</title>
		<link>http://phparmor.com/php-source-code/php-security-and-sql-injection/comment-page-1/#comment-3908</link>
		<dc:creator>drewangell</dc:creator>
		<pubDate>Sat, 20 Mar 2010 14:05:20 +0000</pubDate>
		<guid isPermaLink="false">http://phparmor.com/php-source-code/php-security-and-sql-injection/#comment-3908</guid>
		<description>If you&#039;re using Dreamweaver and its tools to connect to your DB it takes care of correctly writing the code to avoid SQL injection.

If not, read up http://us2.php.net/security.database.sql-injection

My Mind (the Bible)</description>
		<content:encoded><![CDATA[<p>If you&#8217;re using Dreamweaver and its tools to connect to your DB it takes care of correctly writing the code to avoid SQL injection.</p>
<p>If not, read up <a href="http://us2.php.net/security.database.sql-injection" rel="nofollow">http://us2.php.net/security.database.sql-injection</a></p>
<p>My Mind (the Bible)
<p>
				<span id="reportcomment_results_div_3908"><a href="javascript:void(0);" onclick="reportComment_AddTextArea( 3908 );" title="Report this comment" rel="nofollow">Report this comment</a></span><br />
				<span id="reportcomment_comment_div_3908"></span>
			</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: just "JR"</title>
		<link>http://phparmor.com/php-source-code/php-security-and-sql-injection/comment-page-1/#comment-3907</link>
		<dc:creator>just "JR"</dc:creator>
		<pubDate>Sat, 20 Mar 2010 13:07:41 +0000</pubDate>
		<guid isPermaLink="false">http://phparmor.com/php-source-code/php-security-and-sql-injection/#comment-3907</guid>
		<description>Any field that a user fills on a form that you process to a database CAN include vicious piece of code.
To avoid this, you have to check data before inserting (or updating) your tables.
Say you have a field &quot;Address&quot; (usually long), set as a &quot;varchar&quot; (100): that 100 characters can be a command!
Worse: fields defined as &quot;TEXT&quot;.
- Before inserting/updating, check these string queries for malicious code, commands etc (words like &quot;insert&quot;, &quot;delete&quot;, &quot;select&quot;, &quot;create&quot;, file extensions such as &quot;asm&quot;,&quot;exe&quot;), or non-texts (ie characters below 0x1F) and reject if you find one.
However, don&#039;t be too paranoid: if your site is decent, so will be your visitors.
Just make an automatic DB backup daily.

My Mind (the Bible)</description>
		<content:encoded><![CDATA[<p>Any field that a user fills on a form that you process to a database CAN include vicious piece of code.<br />
To avoid this, you have to check data before inserting (or updating) your tables.<br />
Say you have a field &#8220;Address&#8221; (usually long), set as a &#8220;varchar&#8221; (100): that 100 characters can be a command!<br />
Worse: fields defined as &#8220;TEXT&#8221;.<br />
- Before inserting/updating, check these string queries for malicious code, commands etc (words like &#8220;insert&#8221;, &#8220;delete&#8221;, &#8220;select&#8221;, &#8220;create&#8221;, file extensions such as &#8220;asm&#8221;,&#8221;exe&#8221;), or non-texts (ie characters below 0x1F) and reject if you find one.<br />
However, don&#8217;t be too paranoid: if your site is decent, so will be your visitors.<br />
Just make an automatic DB backup daily.</p>
<p>My Mind (the Bible)
<p>
				<span id="reportcomment_results_div_3907"><a href="javascript:void(0);" onclick="reportComment_AddTextArea( 3907 );" title="Report this comment" rel="nofollow">Report this comment</a></span><br />
				<span id="reportcomment_comment_div_3907"></span>
			</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (enhanced)
Database Caching using disk
Object Caching 332/337 objects using disk

Served from: phparmor.com @ 2010-09-08 13:19:55 -->