PHP submits a request to automatically filter out the specified characters in the input box. how can this problem be written?

Source: Internet
Author: User
PHP submits a request to automatically filter out the specified characters in the input box. how can this problem be solved? When submitting data, filter out the & lt; img & nbsp; src = & nbsp; and & nbsp; & gt; & nbsp; characters in all input data and keep other content. How can this be written? PHP submits and automatically filters out the specified characters in the input box. how can this problem be written?
When data is submitted, all characters in input are filtered out and other content is retained.
How can I write this? PHP shares the following:
------ Solution --------------------
$ S = str_replace ('>', '', str_replace ('echo $ s;

------ Solution --------------------

$ Src ='
------ Solution --------------------

------ Solution --------------------
IUs ';
$ Post = $ _ POST ['value'];
Preg_match ($ src, $ post, $ v );
Print_r ($ v );
?>

------ Solution --------------------
If you process the submitted data instead of the received data, you must use regular expressions,
Var s = document. getElementById ('input _ id ');
S = s. replace (/(------ solution --------------------
> +/Ig ,"");
I did case-insensitive and multi-line processing. check if you want it.
------ Solution --------------------
Preg_match ('/"(.*)?. [A-Z] {3, 4} "/I ', $ input_value, $ arr );
Echo $ arr [0];

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.