stublackett Posted July 31, 2008 Share Posted July 31, 2008 I posted yesterday about this, I thought I had the solution but it seems I havent I was reccomended to set an Array for addslashes to my script I've tried it on a different Script and when it inserts into the Database all it inserts is the word "Array" Nothing else ??? My code is as follows : <?php if (!empty($_POST['info'])) { $info = Array("1",addslashes(nl2br($_POST['info']))); }else{ $info = NULL; $errors['info'] = '<p><font color="red">You need to enter info for this directory item</font></p>'; } ?> Whats the best way to incorporate Addslashes or Stripslashes? Link to comment https://forums.phpfreaks.com/topic/117494-stripslashes-or-addslashes/ Share on other sites More sharing options...
MasterACE14 Posted July 31, 2008 Share Posted July 31, 2008 I was reccomended to set an Array for addslashes to my script I've tried it on a different Script and when it inserts into the Database all it inserts is the word "Array" Nothing else ??? If its only inserting "Array" then the addslashes function was not needed for that particular $_POST. In other words. Its working fine. Its a good thing that its inserting "Array", addslashes is for security for $_POST's and other types of data. Link to comment https://forums.phpfreaks.com/topic/117494-stripslashes-or-addslashes/#findComment-604429 Share on other sites More sharing options...
samshel Posted July 31, 2008 Share Posted July 31, 2008 please post more code...or the link to your old post. Link to comment https://forums.phpfreaks.com/topic/117494-stripslashes-or-addslashes/#findComment-604439 Share on other sites More sharing options...
stublackett Posted July 31, 2008 Author Share Posted July 31, 2008 I think, I've sorted it........ But the previous post was : http://www.phpfreaks.com/forums/index.php/topic,209419.msg952127.html#msg952127 I really need to know the best way to represent data that has apostrophes slashes etc in it, As I'm getting an SQL Syntax Error everytime Link to comment https://forums.phpfreaks.com/topic/117494-stripslashes-or-addslashes/#findComment-604459 Share on other sites More sharing options...
craygo Posted July 31, 2008 Share Posted July 31, 2008 Why even put the POST in an array in the first place?? Link to comment https://forums.phpfreaks.com/topic/117494-stripslashes-or-addslashes/#findComment-604460 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.