LiveWire Peer Support Network

Printable Version of Topic "Backslashes being inserted in php-called content of textarea"

- LiveWire Teen Forums & College Forums (http://www.golivewire.com)
-- (http://www.golivewire.com/forums/support-technical.html)
--- Programming & Application Development (http://www.golivewire.com/forums/forum-211-s-0.html)
---- Backslashes being inserted in php-called content of textarea (http://www.golivewire.com/forums/peer-yatpeta-support-a.html)


-- Posted by Mediocre at 6:08 pm on Aug. 10, 2008

Edit: Fixed with http://ca3.php.net/manual/en/security.magicquotes.disabling.php


I'm using fread to insert the contents of a given file into a textarea. Like this:

Code:
$handle = fopen($filename, "r");
$contents = fread($handle, filesize($filename));  
echo "

The problem is that when I submit textarea, php sends it with backslashes before any quotation marks in $content. and escapes other backslashes, etc. For example,
Code:
echo "

becomes
Code:
echo \"

I need to keep baskslashes etc. from the original file, and not send the new ones. How do I do this?


www.golivewire.com