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

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
konx
Forum Newbie
Posts: 2
Joined: Fri Oct 28, 2005 12:38 am
Location: Michigan

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

Post 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?
User avatar
Jenk
DevNet Master
Posts: 3587
Joined: Mon Sep 19, 2005 6:24 am
Location: London

Post by Jenk »

Magic Quotes

Code: Select all

<?php

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

?>
konx
Forum Newbie
Posts: 2
Joined: Fri Oct 28, 2005 12:38 am
Location: Michigan

Post by konx »

thanks alot Jenk!
Learn something new everyday.
Post Reply