PHP拖动验证码提交表单

PHP拖动验证码提交表单

PHP拖动验证码提交表单

PHP拖动验证码解锁表单,支持手机触屏滑动。

源码介绍

滑动验证码表单,action提交到当前页面

 method="post" action=""> 
        >姓名  type="text" name="username" /> 
         type="submit" name="submit" value="提交表单" /> 

               

引入验证码插件

 type="text/javascript" src="jquery/jquery.js"> 
 type="text/javascript" src="jquery/jquery-ui.js"> 
 type="text/javascript" src="jquery/jquery.ui.touch.js"> 
 type="text/javascript" src="jquery/QapTcha.jquery.js">

               

调用QapTcha验证码插件

$(document).ready(function() { 
    $('.QapTcha').QapTcha(); 
});

               

PHP提交表单验证

 
 
if (isset($_POST['submit'])) { 
    $response = ''
    /** SESSION CONTROL * */ 
    if (isset($_SESSION['qaptcha_key']) && !empty($_SESSION['qaptcha_key'])) { 
        $QaptChaInput = $_SESSION['qaptcha_key']; 
        if (isset($_POST['' . $QaptChaInput . '']) && empty($_POST['' . $QaptChaInput . ''])) 
            $response .= '表单已提交姓名 : ' . $_POST['username']; 
        else 
            $response .= '$_POST not empty or unexists'
    } else 
        $response .= '没有SESSION.. 表单不能提交...'
    $response .= '
'; 
    echo $response
    unset($_SESSION['qaptcha_key']); 
}


分享到 :

发表评论

登录... 后才能评论