AdRock Posted August 12, 2010 Share Posted August 12, 2010 I have noticed that today that some of the content that is saved from my form is printing random characters and crap. I am using htmlentities on the form input and it seems to be adding more rubbish. I am using the UTF-8 charset as a meta tag. Is this the correct way of using htmlentities? htmlentities($string, ENT_QUOTES, 'UTF-8') Also i noticed the other day with a problem I had that using htmlentities was replacing " with &" when i thought it should have just been " Quote Link to comment Share on other sites More sharing options...
btherl Posted August 13, 2010 Share Posted August 13, 2010 Make sure you use htmlentities() only once. If you use it more than once on the same data, it will get corrupted. I'm not sure from the post if you are clear on this, but htmlentities() is to encode data for inserting into the html output from your script. It shouldn't be applied to input coming from a form, in usual circumstances. 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.