KMLT Posted February 17, 2009 Share Posted February 17, 2009 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 More sharing options...
Mchl Posted February 17, 2009 Share Posted February 17, 2009 Do you have magic_qoutes enabled? Link to comment https://forums.phpfreaks.com/topic/145557-solved-save-txt-file-problem/#findComment-764139 Share on other sites More sharing options...
KMLT Posted February 17, 2009 Author Share Posted February 17, 2009 Hmm, not sure.. How can I find out if I have? Link to comment https://forums.phpfreaks.com/topic/145557-solved-save-txt-file-problem/#findComment-764142 Share on other sites More sharing options...
Mchl Posted February 17, 2009 Share Posted February 17, 2009 get_magic_quotes_gpc Seriously, it's in the link I gave you. Link to comment https://forums.phpfreaks.com/topic/145557-solved-save-txt-file-problem/#findComment-764144 Share on other sites More sharing options...
KMLT Posted February 17, 2009 Author Share Posted February 17, 2009 Yeah, but I don't get it.. :/ Link to comment https://forums.phpfreaks.com/topic/145557-solved-save-txt-file-problem/#findComment-764147 Share on other sites More sharing options...
Mchl Posted February 17, 2009 Share Posted February 17, 2009 Do echo get_magic_quotes_gpc(); If it shows 1, it means you have magic_quotes enabled Link to comment https://forums.phpfreaks.com/topic/145557-solved-save-txt-file-problem/#findComment-764148 Share on other sites More sharing options...
KMLT Posted February 17, 2009 Author Share Posted February 17, 2009 Yeah, it's enabled.. :-\ Link to comment https://forums.phpfreaks.com/topic/145557-solved-save-txt-file-problem/#findComment-764151 Share on other sites More sharing options...
Mchl Posted February 17, 2009 Share Posted February 17, 2009 So you need to disable it (instructions in the first link) or if it is not possible for whatever reason, use stripslashes Link to comment https://forums.phpfreaks.com/topic/145557-solved-save-txt-file-problem/#findComment-764152 Share on other sites More sharing options...
KMLT Posted February 17, 2009 Author Share Posted February 17, 2009 K thanx! =) Link to comment https://forums.phpfreaks.com/topic/145557-solved-save-txt-file-problem/#findComment-764162 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.