I inserted in database some HTML text after escaping them using mysql_real_escape_string, and I am trying to add them to XML document to be read by flash file, I am using DOMDocument class to make the XML document, here's my tries and outputs: try 1:
$descC = $doc->createCDATASection(stripslashes($sql['body']));
$desc = $doc->createElement('desc');
$desc->appendChild($descC);
output:
A lot of slashes !
try 2:
$desc = $doc->createElement('desc',htmlentities(stripslashes($sql['body'])));
output:
Also alot of slashes
Any ideas ?
I think magic quotes are enabled in your configuration.
you must check it before escaping vai mysql_real_escape_string() as it will add more slashes.
if(get_magic_quotes_gpc()){
$b = stripslashes($b);
}
$b = mysql_real_escape_string($b);