Page 1 of 1

Posts turning -> ' <- into -> /' <-

Posted: Fri Oct 28, 2005 1:06 am
by konx
ok i have a very simple code to write an html form to a text file. If i use a single quote
-> ' <-
in a text box, it will come back to me as -> /' <- .
I'm thinking it is something to do with the server, because i have tested it on another server and it works fine.

This is my code for retreiving the post.

Code: Select all

$d	= Date("m.d.y");
$title	= $_POST['title'];
$text	= $_POST['text'];
$file	= "textfile.txt";
$fp	= fopen($file, "w");
fwrite($fp, $d . "|" . $title . "|" . $text );
fclose($fp);
Here is the php settings on the server i am having problems with.
http://www.billchesney.com/phpinfo.php

Just seems wierd to me that it would do this. Anyone have a clue as to why?

Posted: Fri Oct 28, 2005 1:09 am
by Jenk
Magic Quotes

Code: Select all

<?php

function stripMagicQuotes ($string) {
  if (get_magic_quotes_gpc()) {
    $string = stripslashes($string);
  }
  return $string;
}

?>

Posted: Fri Oct 28, 2005 11:55 am
by konx
thanks alot Jenk!
Learn something new everyday.