PHP verification code is not case sensitive

angryTom
Release: 2023-02-28 07:56:02
Original
4673 people have browsed it

PHP verification code is not case sensitive

php verification code is not case-sensitive

First we use the strtolower function on the verification code stored in SESSION to It is converted to lowercase; then the content submitted by the user is also converted to lowercase using the strtolower function; and finally the comparison is done.

Code:

session_start(); $str_number = trim($_POST['number']); if(strtolower($_SESSION['rand'])==strtolower($str_number )){ echo "验证码正确"; }else{ echo "验证码不正确"; }
Copy after login

For more PHP related knowledge, please visitPHP Chinese website!

The above is the detailed content of PHP verification code is not case sensitive. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!