malma Posted March 6, 2015 Share Posted March 6, 2015 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 More sharing options...
requinix Posted March 6, 2015 Share Posted March 6, 2015 Read the error message more carefully. What function does it say is undefined? I'm using PHP 5.3.0 version, UPGRADE! Link to comment https://forums.phpfreaks.com/topic/295139-problems-with-magic_quotes_gpc/#findComment-1507750 Share on other sites More sharing options...
malma Posted March 8, 2015 Author Share Posted March 8, 2015 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 Link to comment https://forums.phpfreaks.com/topic/295139-problems-with-magic_quotes_gpc/#findComment-1507866 Share on other sites More sharing options...
mac_gyver Posted March 8, 2015 Share Posted March 8, 2015 you need to proof read your code. you have a spelling mistake in the function name. hint - php does not have a global positioning location function. Link to comment https://forums.phpfreaks.com/topic/295139-problems-with-magic_quotes_gpc/#findComment-1507867 Share on other sites More sharing options...
malma Posted March 8, 2015 Author Share Posted March 8, 2015 you need to proof read your code. you have a spelling mistake in the function name. hint - php does not have a global positioning location function. Thank you very much for the help, i have seen what I had done wrong now it works Link to comment https://forums.phpfreaks.com/topic/295139-problems-with-magic_quotes_gpc/#findComment-1507870 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.