Maracles Posted May 25, 2009 Share Posted May 25, 2009 I am following a tutorial in a book which uses the code: get_magic_quotes_gpc however it does really explain what use this has. Can anyone tell me? It does not seem to be the name of a variable or Array or anything. Thanks. Link to comment https://forums.phpfreaks.com/topic/159597-solved-what-is-get_magic_quotes_gpc/ Share on other sites More sharing options...
Daniel0 Posted May 25, 2009 Share Posted May 25, 2009 A deprecated way of escaping GET, POST and COOKIE values. Burn the book and buy a new one. It's too old. Link to comment https://forums.phpfreaks.com/topic/159597-solved-what-is-get_magic_quotes_gpc/#findComment-841793 Share on other sites More sharing options...
Maracles Posted May 25, 2009 Author Share Posted May 25, 2009 Thank you for the update. What would a more modern way of writing the same code be? The current code it is used in is: // create short variable names $searchtype=$_POST['searchtype']; $searchterm=trim($_POST['searchterm']); if (!$searchtype || !$searchterm) { echo 'You have not entered search details. Please go back and try again.'; exit; } if (!get_magic_quotes_gpc()){ $searchtype = addslashes($searchtype); $searchterm = addslashes($searchterm); } Link to comment https://forums.phpfreaks.com/topic/159597-solved-what-is-get_magic_quotes_gpc/#findComment-841799 Share on other sites More sharing options...
Daniel0 Posted May 25, 2009 Share Posted May 25, 2009 It depends on what the search term and type is used for later on in the script. I've written a tutorial you might want to read that covers things like that: http://www.phpfreaks.com/tutorial/php-security Link to comment https://forums.phpfreaks.com/topic/159597-solved-what-is-get_magic_quotes_gpc/#findComment-841803 Share on other sites More sharing options...
Maracles Posted May 25, 2009 Author Share Posted May 25, 2009 Thanks for the help. I will try and read that tutorial tonight. Link to comment https://forums.phpfreaks.com/topic/159597-solved-what-is-get_magic_quotes_gpc/#findComment-841806 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.