Enable magic quotes

Associate
Joined
25 Jul 2004
Posts
805
Location
.
Hi

I have created a website using a hosting company, but I get a security message asking me to enable PHP magic quotes.

Can anyone give me some help with this please?

Many thanks

Phil
 
You shouldn't need to enable magic quotes, just code around them. Magic quotes are being removed from PHP entirely in the next version, so you'll have to start working around them soon anyway.

I generally use something similar to this in my abstraction classes:

Code:
function makeSafe($string) {
    if (PHP_VERSION < 6 && get_magic_quotes_gpc()) {
        $string = stripslashes($string);
    }
    return mysql_real_escape_string($string);
}
 
Back
Top Bottom