Forum Moderators: coopster
Also, aside from just escaping the string you may also want to make sure that it contains the information that you are looking for. You can use regular expressions to check the string for content.
SQL Injection Vulnerability [webmasterworld.com]
PHP Security [webmasterworld.com]
If you have any code that you want us to look through then just post what's relevant.
>>>It seems, though that everything boils down to 'error checking' and escaping.
yup ;)
Is addslashes/stripslashes a sufficient substitute for mysql_real_escape_string or should mysql_real_escape_string still be employed?If so, why?
mysql_real_escape_string escapes \x00, \n, \r, \, ', " and \x1a. Addslashes escapes single quote ('), double quote ("), backslash (\) and NULL. If you are using MySQL, you should go with mysql_real_escape_string or mysql_escape_string.
Why not just use magic_quotes?
This function is identical to mysql_real_escape_string() except that mysql_real_escape_string() takes a connection handler and escapes the string according to the current character set. mysql_escape_string() does not take a connection argument and does not respect the current charset setting.
as for magic_quotes
anything that changes input before you get to see it is a large problem
Is addslashes/stripslashes a sufficient substitute for mysql_real_escape_string or should mysql_real_escape_string still be employed?
as mentionned add slashes doesn't escape all the necessary characters, even after using it sql injection is still possible. used to have a link to an article somewhere but can't find it now, if you do a google search you may be able to find it
[shiflett.org ]