Jump to content

[SOLVED] save .txt file problem..


KMLT

Recommended Posts

I have a problem!

I've made a textbox on my site, with a save button that saves the text as "text.txt"..

Just, that when I save, tags like " and ' becomes \" and \'..

 

 

$thetext=$_POST["thetext"];
$filename = "text.txt";

$fp = fopen($filename,"w");
fputs($fp,$thetext);
fclose($fp);

echo "Saved!<br /><br /><br />";
echo "<a href = \"index.php\">Back!</a>";

code from the save.php file..

I think the problem is here.. because everything else works as it should..

but.. like if I write: Where's.. the text will show up as: Where\'s when I have saved it..

 

anyone know how to fix it?

Link to comment
https://forums.phpfreaks.com/topic/145557-solved-save-txt-file-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.