当前位置:网站首页>Integration and implementation of login click graphic verification code in personal blog system
Integration and implementation of login click graphic verification code in personal blog system
2022-07-28 19:42:00 【wyqgg123】
summary :
I have never realized the login verification code , Today, when I read the verification code online , I saw a PHP Of jQuery Chinese Click verification code plug-in , I will try to introduce the plug-in , I found the plug-in very easy to use , The following is the implementation process
1、 Download address
gitee:https://gitee.com/hooray/clicaptcha.git
2、 quote
<link rel="stylesheet" href="/clicaptcha/css/captcha.css">
<script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>
<script src="https://cdn.bootcss.com/js-cookie/2.2.1/js.cookie.min.js"></script>
<script src="/clicaptcha/clicaptcha.js"></script>
<!-- Graphic verification code -->
<input type="hidden" id="clicaptcha-submit-info" name="clicaptcha-submit-info">
<script> $('#clicaptcha-submit-info').clicaptcha({
src: '/clicaptcha/clicaptcha.php', success_tip: ' Verify success !', error_tip: ' The correct area is not selected , Please try again !', callback: function(){
//... } }); </script>
3、 Integrate into the project
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<title>Login</title>
<link rel="stylesheet" href="/css/layui/css/layui.css">
<script src="/css/layui/layui.js"></script>
<link rel="stylesheet" href="/clicaptcha/css/captcha.css">
<link rel="stylesheet" href="/css/main.css">
<script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>
</head>
<body style="background-color:#5FB878">
<div>
<h1 style="color: #fafafa;text-align: center;line-height: 80px">wyq Blog system background login </h1>
</div>
<div style="width: 30%;height: 40%;position: absolute;left:35%;top:30%;background-color:#FAFAFA">
<div style="width: 100%;height: 20%;background-color: #009688;">
<h1 style="color: #fafafa;text-align: center;line-height: 80px"> Administrator login </h1>
</div>
<div style="padding: 40px;">
<form class="layui-form" action="/admin/doLogin" method="post">
<div class="layui-form-item">
<label class="layui-form-label"> user name </label>
<div class="layui-input-block">
<input type="text" id="username" name="username" placeholder=" Please enter a user name " class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label"> password </label>
<div class="layui-input-block">
<input type="password" id="password" name="password" placeholder=" Please input a password " class="layui-input">
</div>
</div>
<!-- Image verification code hidden field -->
<input type="hidden" id="clicaptcha-submit-info" name="clicaptcha-submit-info">
<button id="submit" type="button" class="layui-btn" style="margin-left: 80px;margin-top: 20px"> Sign in </button>
<a type="button" href="/login/regist" style="margin-left: 250px;margin-top: 20px" class="layui-btn"> register </a>
</form>
<a href="/login/forget" style="margin-top: 20px;"> Forget the password ?</a>
</div>
</div>
</body>
</html>
<script src="https://cdn.bootcss.com/js-cookie/2.2.1/js.cookie.min.js"></script>
<script src="/clicaptcha/clicaptcha.js"></script>
<script> // When you click login $("#submit").click(function () {
// Verify the character you clicked $('#clicaptcha-submit-info').clicaptcha({
src: '/clicaptcha/clicaptcha.php', success_tip: ' Verify success !', error_tip: ' The correct area is not selected , Please try again !', // Successfully called the function callback: function(res){
var data = {
'username': $('#username').val(), 'password': $('#password').val(), 'clicaptcha-submit-info':$('#clicaptcha-submit-info').val() }; $.ajax({
'url': '/login/doLogin', 'type':'post', 'dataType':'json', 'data':data, 'success':function (msg) {
if (msg.code == 200){
layui.use('layer', function() {
var layer = layui.layer; layer.msg(' Login successful '); }) setTimeout(function(){
window.location.replace("/user/index") },800); }else if(msg.code == 400){
layui.use('layer', function() {
var layer = layui.layer; layer.msg(msg.msg); }) } } } ) } }); }) </script>
The page display :
边栏推荐
- SaltStack配置管理
- R language and data analysis practice 11 - data deletion
- 彻底理解位运算——左移、右移
- 2022年全国最新消防设施操作员(中级消防设施操作员)题库及答案
- Left alignment function of Lua language (handwriting)
- 11. Learn MySQL union operator
- MySQL8 Encrypting InnoDB Tablespaces
- 宝塔面板搭建小说CMS管理系统源码实测 - ThinkPHP6.0
- Test Development Notes
- 云计算笔记part.2——应用管理
猜你喜欢

远光软件获得阿里云产品生态集成认证,携手阿里云共建新合作

这个客制化键盘,秀翻我了~

Convertible bond concept table x notation gives you a convenient and fast experience!

宝塔面板搭建小说CMS管理系统源码实测 - ThinkPHP6.0

NetCoreAPI操作Excel表格

leetcode day1 分数排名

WPF 实现带蒙版的 MessageBox 消息提示框

Thoroughly understand bit operations - shift left, shift right

editor.md中markdown编辑器的实现

navicate修改数据库名的方式
随机推荐
[网络]跨区域网络的通信学习IPv4地址的分类和计算
First blog
WPF implements MessageBox message prompt box with mask
助力面板行业创新,FPGA将成屏厂TCON最佳选择?
source insight项目导入和使用教程
OpenOCD如何通过stlink直接下载程序到stm32板子(已解决)
Design of library management database system
Android-第十三节03xUtils-数据库框架(增删改查)详解
我的第二次博客——C语言
MySQL performance testing tool sysbench learning
Cvpr19 - adjust reference dry goods bag of tricks for image classification with revolutionary neural network
stc12c5a60s2功能说明(STC12C5A60S2默认触发)
你知道雨的类型有几种?
The United States will provide $25billion in subsidies to encourage chip manufacturers such as Intel to move back to production lines
Pagoda panel construction novel CMS management system source code measurement - thinkphp6.0
Cvpr21 unsupervised anomaly detection cutpaste:self supervised learning for anomaly detection and localization
MySQL 8 creates master-slave replication based on Clone
Basic concept and essence of Architecture
架构基本概念和架构本质
My second blog - C language