Jump to content

Problems with magic_quotes_gpc


malma

Recommended Posts

I'm using PHP 5.3.0 version, now i'm trying to escape quotes but I'm getting error which I don't know how solve. I'm very new to php and this is my first atempt to learn it. I'm asking for your help please.

 

These are my codes.

 

Fatal error: Call to undefined function get_magic_quotes_gps() in C:\wamp\www\widget\include\functions.php on line 4

function mysql_prep($value) {
    $magic_quotes_active = get_magic_quotes_gps();

    $new_enough_php = function_exists( "mysql_real_escape_string");

    // i.e PHP >= v4.3.0

    if ($new_enough_php) { // PHP v4.3.0 or higher

    // undo any magic quotes effects so mysql_real_escape_string

    // can do the work

    if( $magic_quotes_active) { $value = stripslashes ( $value);}

    $value = mysql_real_escape_string( $value);

    } else {// before PHP v4.3.0

    // if magic quotes aren't already on then add slashes manually

    if (!$magic_quotes_active) {$value = addslashes($value);}

    // if magic quotes aren't active, the the slashes already exist

    }

    return $value;

}

Link to comment
https://forums.phpfreaks.com/topic/295139-problems-with-magic_quotes_gpc/
Share on other sites

Read the error message more carefully. What function does it say is undefined?

 

UPGRADE!

Yes I can read and that but my problem is that I'm very new to php, i can't seem able to find the right way of defining that function, can you please help me to point out how I can do it

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.