Jump to content

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.