EchoFool Posted August 31, 2008 Share Posted August 31, 2008 What order do you put these functions as: mysql_real_escape_string(stripslashes($_POST['letter'])); OR stripslashes(mysql_real_escape_string($_POST['letter'])); I currently have the first method but the ' symbol still crashes my queries...but I want to check that it is the latter first before changing all of them which will take ages.. Link to comment https://forums.phpfreaks.com/topic/122106-what-order-do-i-put-these-as/ Share on other sites More sharing options...
DarkWater Posted August 31, 2008 Share Posted August 31, 2008 It's the first one if magic_quotes_gpc is on, otherwise you don't use stripslashes() at all. Link to comment https://forums.phpfreaks.com/topic/122106-what-order-do-i-put-these-as/#findComment-630417 Share on other sites More sharing options...
EchoFool Posted August 31, 2008 Author Share Posted August 31, 2008 It's the first one if magic_quotes_gpc is on, otherwise you don't use stripslashes() at all. Would it hurt to keep it if they are on encase some how it was turned off or it will cause an error in that situation ? Link to comment https://forums.phpfreaks.com/topic/122106-what-order-do-i-put-these-as/#findComment-630418 Share on other sites More sharing options...
DarkWater Posted August 31, 2008 Share Posted August 31, 2008 You could do a check: if (get_magic_quotes_gpc()) { $var = strip_slashes($var); } $var = mysql_real_escape_string($var); Link to comment https://forums.phpfreaks.com/topic/122106-what-order-do-i-put-these-as/#findComment-630419 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.