Las representaciones son las siguientes:
QapTcha es un sistema captcha arrastrable con jQuery y interfaz jQuery.
QapTcha es un sistema captcha fácil de usar, sencillo e intuitivo. Requiere comportamiento humano, no leer el texto del disco duro, y este es un plugin jQuery muy ligero.
Para funcionar con iPhone y iPad, ¡se ha añadido el archivo jquery.ui.touch.js en la versión 2.5!
QapTcha funciona en PHP5.2 por las razones anteriores para la función json_encode()!
¿Cómo funciona? En la construcción del DOM, QapTcha crea una entrada oculta con un nombre aleatorio "atributo lleno de contraseñas aleatorias." Normalmente, un bot rellena todas las entradas en un formulario antes de enviarlo.
El propósito de la caída es vaciar la entrada aleatoria y establecer una variable $_SESSION [qaptcha_key'] con este valor aleatorio en Ajax.
Con PHP, solo comprueba si la entrada aleatoria existe y está vacía, si $_SESSION['qaptcha_key'] se llena con este valor aleatorio. En archivos PHP, tienes que hacer cosas como:
- // check if $_SESSION['qaptcha_key'] created with AJAX exists
- if(isset($_SESSION['qaptcha_key']) && !empty($_SESSION['qaptcha_key']))
- {
- $myVar = $_SESSION['qaptcha_key'];
-
- // check if the random input created exists and is empty
- if(isset($_POST[''.$myVar.'']) && empty($_POST[''.$myVar.'']))
- {
- //mail can be sent
- }
- else
- {
- //mail can not be sent
- }
- }
- unset($_SESSION['qaptcha_key']);
Copiar código Implementation:
1. Primero, incluir los archivos CSS & jQuery- <!-- include CSS & JS files -->
- <!-- CSS file -->
- <link rel="stylesheet" type="text/css" href="QapTcha.jquery.css" media="screen" />
-
- <!-- jQuery files -->
- <scrip去掉t type="text/javascrip去掉t" src="jquery.js"></scrip去掉t>
- <scrip去掉t type="text/javascrip去掉t" src="jquery-ui.js"></scrip去掉t>
- <scrip去掉t type="text/javascrip去掉t" src="jquery.ui.touch.js"></scrip去掉t>
- <scrip去掉t type="text/javascrip去掉t" src="QapTcha.jquery.js"></scrip去掉t>
Copiar código 2. añade un DIV con la clase "qaptcha" en tu formulario
- <form method="post" action="">
- <fieldset>
- <label>First Name</label> <input type="text" name="firstname" />
- <label>Last Name</label> <input type="text" name="lastname" />
- <div class="clr"></div>
-
- <!-- Add this line in your form -->
- <div class="QapTcha"></div>
-
- <input type="submit" name="submit" value="Submit form" />
- </fieldset>
- </form>
Copiar código 3. PHP control antes de enviar el formulario
- // check if $_SESSION['qaptcha_key'] created with AJAX exists
- if(isset($_SESSION['qaptcha_key']) && !empty($_SESSION['qaptcha_key']))
- {
- $myVar = $_SESSION['qaptcha_key'];
-
- // check if the random input created exists and is empty
- if(isset($_POST[''.$myVar.'']) && empty($_POST[''.$myVar.'']))
- {
- //mail can be sent
- }
- else
- {
- //mail can not be sent
- }
- }
- unset($_SESSION['qaptcha_key']);
Copiar código 4. Ahora, llama al plugin Qaptcha
- <scrip去掉t type="text/javascrip去掉t">
- $(document).ready(function(){
- // Simple call
- $('.QapTcha').QapTcha();
-
- // More complex call
- $('.QapTcha').QapTcha({
- autoSubmit : true,
- autoRevert : true,
- PHPfile : 'path_to_my_php_file/Qaptcha.jquery.php'
- });
- });
- </scrip去掉t>
Copiar código
QapTcha-master.zip
(53.93 KB, Número de descargas: 13)
|