Chủ Nhật, 25 tháng 8, 2013

QapTcha : jQuery captcha giới thiệu

Giới thiệu:
Bình thường capchar thì rất quen thuộc dùng để chống spam tự động đối với các form.
Theo công nghệ các thiết bị cầm tay cảm ứng, thì capchar có thay đổi 1 chút để phù hợp. Thay vì gõ chữ đó là ... kéo rê để khởi động hoặc xác nhận là có người sử dụng - gọi là QAPTCHAR.
Yêu cầu hệ thống: PHP
Giao diện hiển thị:


Link trang chủ (demo, linkdownload): http://www.myjqueryplugins.com/jquery-plugin/qaptcha
Cách thực hiện: 
1. Load  css + script
<link rel="stylesheet" type="text/css" href="QapTcha.jquery.css" media="screen" />
 
<!-- jQuery files -->
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="jquery-ui.js"></script>
<script type="text/javascript" src="jquery.ui.touch.js"></script>
<script type="text/javascript" src="QapTcha.jquery.js"></script> 
2. Run script
<script type="text/javascript">
  $(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'
    });
  });
</script>

3. Thêm đoạn html vào Form.
<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>

Chú ý: cần giữ folder file Root/PHP

0 nhận xét:

Đăng nhận xét