Carterhost Posted July 10, 2007 Share Posted July 10, 2007 Hi. I want to be able to store HTML input from a text field, and I wanted to encode it when it went in, so that it didn't break the PHP as it was assigning it to the variable. so I used URLEncode and URLdecode, but thenin text, "you'll" ends up as "you�ll", which is not what I want. Is there something else I could use? I've looked at a few functions in the man pages, but I don't think they're what I need. Cheers muchly. Quote Link to comment Share on other sites More sharing options...
soycharliente Posted July 10, 2007 Share Posted July 10, 2007 I use mysql_real_escape_string() before putting it in the db. Then when pulling it out, use things like htmlentities() and nl2br(). Quote Link to comment Share on other sites More sharing options...
Carterhost Posted July 10, 2007 Author Share Posted July 10, 2007 Thanks, I'll try that. It seems that this only occurs when it's edited on a mac. PC's are fine (Vista, XP and Kubuntu all tested okay) Anyone know why?? Quote Link to comment Share on other sites More sharing options...
Wildbug Posted July 10, 2007 Share Posted July 10, 2007 Mac uses "\r" instead of "\n" as line terminators. Issues like this are usually related to that. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.