Jump to content

How can i escape the XML syntax


fekaduw

Recommended Posts

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??

 

Link to comment
https://forums.phpfreaks.com/topic/56457-how-can-i-escape-the-xml-syntax/
Share on other sites

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.