Home PHP Libraries Other libraries An 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 code php verification code class php verification code

25 Jul 2016

php verification code class php verification code

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

13 Jan 2017

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.

An explanation of the php Captcha verification code class An explanation of the php Captcha verification code class

11 Jun 2018

<?php/** Captcha 驗證碼類* Date: 2011-02-19* Author: fdipzone*/class Captcha{ //class start private $sname = ''; public function __construct($sname=''){ // $sname captcha session name $this->

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

12 Jul 2016

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 class PHP verification code file class

25 Jul 2016

PHP verification code file class

PHP implements verification code class PHP implements verification code class

18 Apr 2018

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