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 " Link to comment https://forums.phpfreaks.com/topic/210590-random-symobols-printed-in-html-output/ 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. Link to comment https://forums.phpfreaks.com/topic/210590-random-symobols-printed-in-html-output/#findComment-1098721 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.