simun Posted July 27, 2009 Share Posted July 27, 2009 i have a form that write a text in .txt file now when i write something like: aaa "bbb" i seve it in .txt file like: aaa \"bbb\" now when i echo this text file it look like: aaa \ how to make that i can write and read quotes from a text file? Link to comment https://forums.phpfreaks.com/topic/167615-write-quotes-to-txt-file/ Share on other sites More sharing options...
irkevin Posted July 27, 2009 Share Posted July 27, 2009 try using stripslashes() Link to comment https://forums.phpfreaks.com/topic/167615-write-quotes-to-txt-file/#findComment-883885 Share on other sites More sharing options...
patrickmvi Posted July 27, 2009 Share Posted July 27, 2009 It's probably due to the fact that you're writing data that's coming from $_GET, $_POST or $_COOKIE right into your txt file and that you have magic_quotes_gpc (http://us.php.net/magic_quotes) turned on. Link to comment https://forums.phpfreaks.com/topic/167615-write-quotes-to-txt-file/#findComment-883889 Share on other sites More sharing options...
simun Posted July 28, 2009 Author Share Posted July 28, 2009 yes, i am usinh get and post,, where i have to use magic qutes? when i read the file or wher i write the file? Link to comment https://forums.phpfreaks.com/topic/167615-write-quotes-to-txt-file/#findComment-884687 Share on other sites More sharing options...
simun Posted July 28, 2009 Author Share Posted July 28, 2009 if i add this: echo stripslashes($theData); it remove all the text after quotes. how to remove onley slashes??? Link to comment https://forums.phpfreaks.com/topic/167615-write-quotes-to-txt-file/#findComment-884713 Share on other sites More sharing options...
simun Posted July 28, 2009 Author Share Posted July 28, 2009 this work fine: $naslovi = stripslashes($theData); echo $naslovi; but i need to echo it here: <a class="thickbox" title="<? echo $naslovi;?>" href="/images/cache/objects/<?=$object->id?>/<?=$photo['filename']?>/w-800.jpg" rel="galler"> and here that dont work, where is the problem? Link to comment https://forums.phpfreaks.com/topic/167615-write-quotes-to-txt-file/#findComment-884728 Share on other sites More sharing options...
simun Posted July 28, 2009 Author Share Posted July 28, 2009 anyone? Link to comment https://forums.phpfreaks.com/topic/167615-write-quotes-to-txt-file/#findComment-884790 Share on other sites More sharing options...
patrickmvi Posted July 28, 2009 Share Posted July 28, 2009 Stripslashes should work just fine. You might not be seeing all of the text if you're outputting it as HTML due to some special char issues. When you're not seeing portions of the text, you should always check the source. The source is a better representation of what is actually happening. My guess would be that it would be in the source. I've never seen stripslashes remove entire chunks of text from a string before. Link to comment https://forums.phpfreaks.com/topic/167615-write-quotes-to-txt-file/#findComment-884796 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.