Re: POST adding extra characters
| From: | Jim Lucas | Date: | Thu, 21 Jun 2007 03:03:34 +0000 |
| Subject: | Re: POST adding extra characters | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-257531@lists.php.net to get a copy of this message | ||
chris@aquanuke.com wrote:
Hi.. when using POSTon a text box to send info its adding an extra \ character. <form action="script.php" method="POST"> <TEXTAREA NAME="save" COLS=100 ROWS=15> dry-run: filter: account-id = '10002' select: key </textarea> <P><br><INPUT TYPE="submit" VALUE="submit"> </FORM></a> That information is then written to a text file with.. $msg = $ud_save; $f = fopen("file.txt", 'w'); fwrite($f, $msg); fclose($f); Whats written to the text file should be.. dry-run: filter: account-id = '10002' select: key but its writting this instead.. dry-run: filter: account-id = \'10002\' select: key How can I stop it addind the backslashes \ Thanks Chris sounds like you have magic quotes enabled.something like this at the top of you script will fix the problem. if ( get_magic_quotes_gpc() ) { $_GET = array_map("stripslashes", $_GET); $_POST = array_map("stripslashes", $_POST); $_REQUEST = array_map("stripslashes", $_REQUEST); } -- Jim Lucas "Some men are born to greatness, some achieve greatness, and some have greatness thrust upon them." Twelfth Night, Act II, Scene V by William Shakespeare