search
HomeBackend DevelopmentPHP Problemphp verification code error refresh

php verification code error refresh

Sep 29, 2019 am 11:54 AM
phprefreshmistakeVerification code

php verification code error refresh

PHP implements automatic refresh of verification code input errors

After verification code verification fails, $this->error('Verification code does not exist) Correct!') processing. If an error occurs, it will automatically return to the previous page, but the verification code will not be refreshed after returning. At this time, you can use $this->success('The verification code is incorrect!') to handle it, followed by an exit statement to stop the execution and prevent two prompt screens from appearing. In this way, when returning to the login page, the verification code will be automatically refresh.

Code:

$this->success('验证码不正确!');exit;

Attached is the source code processing method when there is no second parameter
success

if(!isset($this->jumpUrl))     
$this->assign("jumpUrl",$_SERVER["HTTP_REFERER"]);

error

if(!isset($this->jumpUrl))     
$this->assign('jumpUrl',"javascript:history.back(-1);");

Recommended tutorial: PHP video tutorial

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

Statement
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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool