search
HomePHP LibrariesOther librariesAn exquisite verification code class in php
An exquisite verification code class in php
<?php
//打印上一个session;
//echo "上一个session:<b>".$_SESSION["authnum_session"]."</b><br>";
$validate="";
if(isset($_POST["validate"])){
  $validate=$_POST["validate"];
  echo "您刚才输入的是:".$_POST["validate"]."<br>状态:";
  if($validate!=$_SESSION["authnum_session"]){
//判断session值与用户输入的验证码是否一致;
    echo "<font color=red>输入有误</font>";
  }else{
    echo "<font color=green>通过验证</font>";
  }
}

First create a complete verification page, and then open the session on the page first,

Remove the session, so that you can get a new session value every time;

The effect of using seesion is good, It’s also very convenient


Disclaimer

All resources on this site are contributed by netizens or reprinted by major download sites. Please check the integrity of the software yourself! All resources on this site are for learning reference only. Please do not use them for commercial purposes. Otherwise, you will be responsible for all consequences! If there is any infringement, please contact us to delete it. Contact information: admin@php.cn

Related Article

php verification code class php verification codephp verification code class php verification code

25Jul2016

php verification code class php verification code

An encapsulated asp.net verification code classAn encapsulated asp.net verification code class

13Jan2017

Yesterday in a Q group, the group leader posted a demo of using ASP.NET to implement verification code. I downloaded it and ran it normally. The img tag on the page successfully called a general handler and displayed the Chinese verification code image, although it was a little bit It's blurry, but it can be seen that there are four Chinese characters on it. The background of the picture is white, there are noise lines behind it, and the border is black.

Verification code class, php verification code class_PHP tutorialVerification code class, php verification code class_PHP tutorial

12Jul2016

Verification code class, php verification code class. Verification code class, php verification code class. Familiar with related image processing functions, simple verification code class 1 // code class 2 class ValidateCode { 3 private $charset = 'abcdefghkmnprstuvwxyzABCDEFGHKMNP

PHP verification code file classPHP verification code file class

25Jul2016

PHP verification code file class

PHP implements verification code classPHP implements verification code class

18Apr2018

This article mainly introduces the use of PHP to implement the verification code class. It has certain reference value. Now I share it with you. Friends in need can refer to it.

See all articles