HardwareLogic

Go Back   HardwareLogic > Specific Hardware > Internet/Networking
Home Forums Rules All AlbumsBlogs Donate Subscriptions Register Mark Forums Read vBExperience

Internet/Networking Everything concerning your internet connection or network, as well as browsers.

Reply
 
LinkBack Thread Tools
Old February 7th, 2007   #1
Points: 2,077, Level: 27
Points: 2,077, Level: 27 Points: 2,077, Level: 27 Points: 2,077, Level: 27
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
pc_guy's Avatar
 
Join Date: Nov 2006
Location: Inside an igloo, Canada
Posts: 313
Default SQL Injection Attacks question. Anybody?

I am currently working on a PHP/mySQL based website and wanted to get some feedback if I'm doing it correctly.

There are a few sections that use GET to pass info, including category id's and names to another page, then its searched it in the database.

I am using:

Code:
mysql_real_escape_string($categoryid);
Is this enough to prevent injection attacks?

I have tried the classic OR 1=1 with:

Code:
example sql:
Select * FROM sometable id = ".$categoryid

result would be:
Select * FROM sometable id = 5 OR 1=1
This failed, and returned all rows

By adding single quotes around the inserted variable:
Code:
Select * FROM sometable id = '".$categoryid."'"
It works, even though I'm not used to putting quotes around numbers.

Has anyone used mysql_real_escape_string in the past and is it enough?



|| AMD Athlon64 3800+ Venice | Asus A8N5X s939 | OCZ Premier PC3200 Du-Ch 1GB | Sapphire X1600Pro 512MB PCI-e | 1xWD 80Gb & 1xWD 250Gb Sata(s) | Antec SLK3800B Case | Enermax NoiseTaker 485W ||

Last edited by pc_guy; February 7th, 2007 at 11:12.
pc_guy is offline   Reply With Quote
Reply

  HardwareLogic > Specific Hardware > Internet/Networking


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
New ant species attacks electronics screwballl HL Lounge 7 May 18th, 2008 08:45
Hawk attacks girl on school tour of Fenway Capper HL Lounge 8 April 4th, 2008 20:04


All times are GMT -8. The time now is 01:00.


Powered by vBulletin® Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.1.0
© HardwareLogic 2005 - 2008. All Rights Reserved


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45