fekaduw Posted June 20, 2007 Share Posted June 20, 2007 hello everyone, i have a textarea where users can input information about themselves. They can even edit the texts (making the texts bold, italic...). It works fine when i try to add the info into the db. But when i try to display the info from the db, it displays some characters like \\\\" whatever. I used stripslashes, but it didn't solve the problem. What do you advise me so that i can handle the XML special characters not to disturb my design?? Quote Link to comment https://forums.phpfreaks.com/topic/56457-how-can-i-escape-the-xml-syntax/ Share on other sites More sharing options...
trq Posted June 20, 2007 Share Posted June 20, 2007 Are you using addslashes on the data before you are submitting it to the db? And if so... are you checking to see if magic_quotes_gpc is enabled beforehand. eg; <?php if (!get_magic_quotes_gpc()) { $data = addslashes($data); } ?> If magic_quotes_gpc is enabled, there is no need to use addslashes. Quote Link to comment https://forums.phpfreaks.com/topic/56457-how-can-i-escape-the-xml-syntax/#findComment-278846 Share on other sites More sharing options...
fekaduw Posted June 20, 2007 Author Share Posted June 20, 2007 i used the mysql_real_escape_string($data) rather than the addslashes Quote Link to comment https://forums.phpfreaks.com/topic/56457-how-can-i-escape-the-xml-syntax/#findComment-278856 Share on other sites More sharing options...
trq Posted June 20, 2007 Share Posted June 20, 2007 Take a look at example 1428 here. You may need to apply something similar. Quote Link to comment https://forums.phpfreaks.com/topic/56457-how-can-i-escape-the-xml-syntax/#findComment-278865 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.