Home  >  Article  >  Backend Development  >  Filter dangerous html code in form submission with php

Filter dangerous html code in form submission with php

WBOY
WBOYOriginal
2016-07-25 08:42:23834browse
The HTML code of the PHP filter submission form may contain code that can be exploited to introduce external dangerous content. For example, sometimes the user submission form contains HTML content, but this may cause confusion in the display page layout and needs to be filtered out.
  1. function uht($str)
  2. {
  3. $farr = array(
  4. "/s+/", //Filter excess whitespace
  5. //Filter