After some testing I have developed a function for escaping user inputs. the escaped values can be directly used for inserting to database. It is working fine for me for the last few years..
function safe_escape($string)
{
if(get_magic_quotes_gpc()){
$string = htmlentities($string);
}else{
$string = mysql_real_escape_string($string);
$string = htmlentities($string);
}
return $string;
}
Blogger templates
Blogger news
Blogroll
Archives
-
▼
2011
(212)
-
▼
October
(10)
- Getting Started with NetBeans IDE
- Display local country time, instent of displaying ...
- A simple and useful function for escaping user inp...
- Database Connection
- New cart TomatoCart
- PHP Operators Index
- Booleans data type in php
- get someone else's facebook account password
- First Post
- scalar data types in php
-
▼
October
(10)