alexweber15 Posted October 13, 2008 Share Posted October 13, 2008 im sorry admins, not sure if this is the appropriate board if not please move it. basically, as far as cleaning data for mysql insertion, ive read that these 2 functions are important and also that you should undo magic_quotes_gpc() if its available and implement mysql_real_escape_string() instead.... so far so good! but where does stripslashes() come into play? thanks! -Alex Link to comment https://forums.phpfreaks.com/topic/128195-solved-stripslashes-vs-mysql_real_escape_string/ Share on other sites More sharing options...
CroNiX Posted October 13, 2008 Share Posted October 13, 2008 You use stripslashes if your test for magic_quotes_gpc() is true to undo the magic quotes. Then use mysql_real_escape_string(). something like: <?php function escapeString($string, $dblink) { if(get_magic_quotes_gpc() == 1) { $string=stripslashes($string); } return mysql_real_escape_string($string, $dblink); } Link to comment https://forums.phpfreaks.com/topic/128195-solved-stripslashes-vs-mysql_real_escape_string/#findComment-664100 Share on other sites More sharing options...
alexweber15 Posted October 13, 2008 Author Share Posted October 13, 2008 thanks! Link to comment https://forums.phpfreaks.com/topic/128195-solved-stripslashes-vs-mysql_real_escape_string/#findComment-664111 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.