|  | Posted by Mara Guida on 06/17/12 11:34 
StevePBurgess@gmail.com wrote:> Ok. I have checked the magic quotes is on.
 
 Can't you turn it off?
 
 > A PHP script processes [the POST data]. If there any errors the input
 > is urlencoded and returned to the webpage
 
 urlencoded? spaces shown as "+"?
 
 <snip>
 > Any thoughts?
 
 
 This works for me, both with magic_quotes_gpc Off or On
 
 ========
 <?php
 if (get_magic_quotes_gpc()) {
 function magic_UNquote($txt) {
 return stripslashes($txt);
 }
 } else {
 function magic_UNquote($txt) {
 return $txt;
 }
 }
 echo '$_POST[\'txt\'] = [', $_POST['txt'], "]<br />\n<br />\n";
 $val = (isset($_POST['txt']) && ($_POST['txt'] !=
 ''))?(magic_UNquote($_POST['txt'])):('three quotes: """; three single
 quotes: \'\'\'; three slashes: ///; three backslashes: \\\\\\; and
 nothing more!');
 $val = str_replace('"', '"', $val);
 echo '$val = [', $val, "]<br />\n<br />\n";
 ?>
 <form action="" method="post">
 <input type="text" name="txt" size="120" value="<?php echo $val; ?>"
 /><input type="submit" />
 </form>
 ========
 
 HTH
  Navigation: [Reply to this message] |