0

On my site im using friendlyURL by .htaccess. but site receiving SQL Injection queries. how can i protect my site from sql injection by htaccess?

Quassnoi
  • 413,100
  • 91
  • 616
  • 614
iProgrammer
  • 756
  • 2
  • 10
  • 20

2 Answers2

3

You can't protect index.php from sql-injection using .htaccess.

To protect your site you have to rewrite your code. That's the only way.

So, start with PDO or SafeMysql right now.

Community
  • 1
  • 1
Your Common Sense
  • 156,878
  • 40
  • 214
  • 345
-1

You cannot protect you site form sql injections with .htaccess. .Htaccess will prevent unauthorized access to your web site or parts of it. The only way to prevent sql injections is to write safe query code by parametrize your sql queries.

Do not you queries like

"Select * from TABLE where COLUMN = '$VARIABLE'"

Use this:

'SELECT * FROM TABLE WHERE COLUMN = $1', array($variable)
idipous
  • 2,868
  • 3
  • 30
  • 45