fekaduw Posted March 6, 2007 Share Posted March 6, 2007 hello everyone, i just used the addslashes() function while inserting a text into my db(MySql). but when i try to display the text back, it adds the backslashes. (eg: \\\\\\\"My Text\\\\\\\") I use the stripslashes function, but it didn't work out. is there any other way out to avoid the backslashes? thanks a lot Link to comment https://forums.phpfreaks.com/topic/41514-how-can-i-remove-the-backslashes/ Share on other sites More sharing options...
boo_lolly Posted March 6, 2007 Share Posted March 6, 2007 stripslashes() it WILL work. you're doing something else wrong. post some code. Link to comment https://forums.phpfreaks.com/topic/41514-how-can-i-remove-the-backslashes/#findComment-201102 Share on other sites More sharing options...
fekaduw Posted March 6, 2007 Author Share Posted March 6, 2007 Here is the code that i used "<tr><td>".stripslashes($row["Description"])."</td></tr>"; the $row simply fetches the text from the database... Link to comment https://forums.phpfreaks.com/topic/41514-how-can-i-remove-the-backslashes/#findComment-201122 Share on other sites More sharing options...
boo_lolly Posted March 6, 2007 Share Posted March 6, 2007 have you compared what it prints with the contents of the database field? try: stripslashes(stripslashes(stripslashes($row['Description']))) Link to comment https://forums.phpfreaks.com/topic/41514-how-can-i-remove-the-backslashes/#findComment-201124 Share on other sites More sharing options...
fekaduw Posted March 6, 2007 Author Share Posted March 6, 2007 sorry again, the data in the db and the text that is displayed on the page is similar. i think the stripslashes is not working. it simply displays without removing the backslashes. i also tried three stripslashes, but it didn't work. thanks for your help Link to comment https://forums.phpfreaks.com/topic/41514-how-can-i-remove-the-backslashes/#findComment-201169 Share on other sites More sharing options...
boo_lolly Posted March 6, 2007 Share Posted March 6, 2007 sorry again, the data in the db and the text that is displayed on the page is similar. i think the stripslashes is not working. it simply displays without removing the backslashes. i also tried three stripslashes, but it didn't work. thanks for your help is it similar, or is it EXACTLY the same? those are two completely different statements, and in order to help you, we need to know accurate information. post MORE code. not just a couple of lines. let's see the whole document. Link to comment https://forums.phpfreaks.com/topic/41514-how-can-i-remove-the-backslashes/#findComment-201203 Share on other sites More sharing options...
fekaduw Posted March 12, 2007 Author Share Posted March 12, 2007 hello there, its just EXACTLY the same. what is stored in the database and what is displayed is EXACTLY the same. Link to comment https://forums.phpfreaks.com/topic/41514-how-can-i-remove-the-backslashes/#findComment-205740 Share on other sites More sharing options...
boo_lolly Posted March 13, 2007 Share Posted March 13, 2007 for the second time... post some code. Link to comment https://forums.phpfreaks.com/topic/41514-how-can-i-remove-the-backslashes/#findComment-205969 Share on other sites More sharing options...
fekaduw Posted March 13, 2007 Author Share Posted March 13, 2007 hello there, here are some of the codes that i used. $vtitle=addslashes($_POST["title"]); $vdescription=addslashes($_POST["Message2"]); $vpicture=addslashes($_POST["Picture"]); $vpicfilename=addslashes($_POST["Picname"]); $vshort_desc=addslashes($_POST["shortdesc"]); I tried to look into the content of the db and a sample data looks something like this: <P class=MsoNormal style=\"\"\"\"\"\"\"MARGIN: \" \\\\? 0in \\? \\\\\\\\? \\\\\\\\\\\\\\\\? \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\? 0pt\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\?><SPAN style=\"\"\"\"\"\"\"FONT-SIZE: \" \\\\? \\? FONT-FAMILY: 9pt; \\\\\\\\? \\\\\\\\\\\\\\\\? \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\? Arial\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\?>This edition marks the fifth anniversary of SPECIFY: Building Product Information Catalogue. Since its introduction five years ago, the number of companies listed in the Catalogue has doubled and has made available diverse products and services to its users.<SPAN style=\"\"\"\"\"\"\"mso-spacerun: \" \\\\? \\? \\\\\\\\? \\\\\\\\\\\\\\\\? \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\? yes\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\?> </SPAN>With the increased expansion of the building industry, the need for organized information is becoming even more crucial year by year.</SPAN><SPAN style=\"\"\"\"\"\"\"FONT-SIZE: \" \\\\? \\? FONT-FAMILY: 9pt; \\\\\\\\? \\\\\\\\\\\\\\\\? \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\? Arial\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\?><?xml:namespace prefix = o ns = \"\\\"\\\\\\\"\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"urn:schemas-microsoft-com:office:office\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\"\\\\\\\"\\\"\" /><o:p> </o:p></SPAN></P> <P class=MsoNormal style=\"\"\"\"\"\"\"MARGIN: \" \\\\? 0in \\? \\\\\\\\? \\\\\\\\\\\\\\\\? \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\? 0pt\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\?><SPAN style=\"\"\"\"\"\"\"FONT-SIZE: \" \\\\? \\? FONT-FAMILY: 9pt; \\\\\\\\? \\\\\\\\\\\\\\\\? \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\? Arial\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\?>In 2005 introduced a website based catalogue complementary to the paper catalogue. With all its flexibility and versatility, the digital version is an ideal medium to promote building products and services.<o:p></o:p></SPAN></P> <P class=MsoNormal style=\"\"\"\"\"\"\"MARGIN: \" \\\\? 0in \\? \\\\\\\\? \\\\\\\\\\\\\\\\? \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\? 0pt\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\?><SPAN style=\"\"\"\"\"\"\"FONT-SIZE: \" \\\\? \\? FONT-FAMILY: 9pt; \\\\\\\\? \\\\\\\\\\\\\\\\? \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\? Arial\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\?><o:p></o:p></SPAN></P> <P class=MsoNormal style=\"\"\"\"\"\"\"MARGIN: \" \\\\? 0in \\? \\\\\\\\? \\\\\\\\\\\\\\\\? \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\? 0pt\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\?><SPAN style=\"\"\"\"\"\"\"FONT-SIZE: \" \\\\? \\? FONT-FAMILY: 9pt; \\\\\\\\? \\\\\\\\\\\\\\\\? \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\? Arial\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\?>This edition has listed entries that range from roofing tiles, electro-mechanical products, sanitary fittings, wooden doors, internal and external finishes, decorative plaster, motorized shutters and gates, earth-moving equipments, curtain walls, furnishings, auditorium seats with built-in public address and voting systems, low voltage products and to aluminums products.<o:p></o:p></SPAN></P> I have used the stripslashes function while retrieving the data: $description=$description."<tr><td><table border='0' width='100%' cellspacing='0'><tr><td valign='top' class='header-home'>".stripslashes($row["title"])."</td><td align='right' valign='top' class='header-postdate'>Posted on: ".date("M d, Y",$row["postdate"])."</tr></table></td></tr>"; $description=$description."<tr class='body-home'><td valign='top' class='justifiedtext'><span style='float:right'> <img src='admin/upload/".stripslashes($row["imagename"])."' border='1'></span>".stripslashes($row["Description"])."</td></tr>"; $description=$description."<tr class='body-home'> <td align='right'> <table border=0> <tr> <td align='right' class='nav_home'><a href='index.php'> Back </a> </td> </tr> </table> </td> </tr>"; $description=$description."<tr><td valign='top' height='10'> </td></tr>"; echo $description; any help highly appreciated Link to comment https://forums.phpfreaks.com/topic/41514-how-can-i-remove-the-backslashes/#findComment-206249 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.