Php-question about the PHP regular expression authentication username? Zhang Si

Source: Internet
Author: User
Basically, but this is not the case. if the user name is changed to Michael Jacob, why? Thank you for your patience. & Quot; Supplement 1: reply to the answer: the blank space contains two spaces, one half-width, and one full-width s. you can use this method, you can also use a single half-width space to OK, and add the full-width filter to James. I just learned this, but I really don't understand it. thank you for your answers. I hope you can solve it. Supplement 2: JS verification can pass Zhang Si! & Quot; if ([& lt; & gt; & #39; & quot;]. test (fm. username. value) {alert (& quot; the user name contains invalid characters & quot;); fm regular php

Basically, but this is not the case. if the user name is changed to Michael Jacob, why? Thank you for your patience.



   \ '\ "\]/'; If (preg_match ($ _ char_pattern, $ _ string) {echo 'user name cannot contain sensitive characters! ';} Else {echo' no sensitive character ';}?>

Supplement 1:

Reply to the answer:
The blank space contains two spaces, one half-width and one full-width space.

\ S can use this function. It can also be OK to use a single half-width space. if you add a full-width filter, James cannot pass through.

I just learned this, but I really don't understand it;

Thank you for your answers. I hope you can solve this problem.

Supplement 2:

JS verification can be passed through James!

If (/[<> \ '\ "\]/. test (fm. username. value) {alert ("the user name contains invalid characters"); fm. username. focus (); return false ;}

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.