LiveWire Network Peer Answers Peer Support Teen Forums Tech Forums College Forums 636 users online 224611 members 838 active today Advertise Here Sign In
TeenCollegeTechPhotos | Quizzes | LiveSecret | Memberlist | Dictionary | News | FAQ
Member Spotlight
Master Rupert
Cool Things: Friendship
Mood: Excited
You have 1 new message.
Emergency Help
Until you sign up you can't do much. Yes, it's free.

Sign Up Now
Membername:
Password:
Already have an account?
Invite Friends
Active Members
Groups
Contests
Moderators
5 online / 30 MPM
Fresh Topics
  LiveWire / Technical Forums / Programming & Application Development / Adding Reply

Adding Reply
Archived Topic: It will not be bumped to the top of the forum.
Topic Backslashes being inserted in php-called content of textarea
Membername   Not a member? Sign Up Free (takes 20 seconds)
Password   Forgotten your password?
Post

Font:   Size:   Color:

FAQ Keyword Search:
Post Options
Favorites Manager
Notify me of new replies to this topic by email
Notify me of new replies to this topic by private message
Original Post
Mediocre Posted 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 "<textarea>".$contents."</textarea>

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 "<div style=\"text-align:right;\" id=\"header\">

becomes
Code:
echo \"<div style=\\\"text-align:right;\\\" id=\\\"header\\\">

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

Replies
I am next Posted at 6:14 pm on Aug. 10, 2008
Post from this position was omitted due to content violations
Mediocre Posted at 6:10 pm on Aug. 10, 2008
Post from this position was omitted due to content violations
Chassidyandmagnum Posted at 6:09 pm on Aug. 10, 2008
Post from this position was omitted due to content violations
All 3 previous replies displayed.