How to prevent saving unusual HTML entities from PHP form? -


Every now and then, I save unusual data from my PHP form to the database that looks like this:

  Mr. Smith & amp; Amp; Amp; Amp; Amp; Amp; Amp; Amp; Amp; Amp; Amp; Amp; Amp; Amp; Amp; Amp; Amp; Amp; Amp; Amp; Amp; Amp; Amp; Amp;   

What could be the reason for this, and there is a better way to remove entities from using preg_replace , because PHP decoded functions are completely Does not completely decode from?

itemprop = "text">

I will suggest viewing the code processing data from the form entry in the database. If you are monitoring data appearing on a web page, then htmlentities ($ var); If you are just cleaning it for security purposes or simply mysql_real_escape_string ($ var) . If everything fails to post the code and we will get a look.

Comments