CI Framework Verification Code CAPTCHA Helper function Usage example, cicaptcha_php tutorial

Source: Internet
Author: User

CI Framework Verification Code CAPTCHA Auxiliary function usage example, Cicaptcha


This paper describes the use of CI Framework Verification Code CAPTCHA auxiliary function, and share it for everyone's reference. Specific as follows:

Using the Captcha helper function is convenient to generate verification code, but the picture is stored in the folder, not the output stream, the feeling is not perfect, can be used.

Description: Generates a 4-bit random number, and the Captcha folder is established under the CI root directory.
Copy the Code code as follows: <?php
$this->load->helper (' captcha ');
$vals = Array (
' word ' = rand (1000, 10000),
' Img_path ' = './captcha/',
' Img_url ' = ' http://localhost/ci/captcha/',
' Font_path ' = './path/to/fonts/texb.ttf ',
' img_width ' = ' 150 ',
' Img_height ' = 30,
' Expiration ' = 7200
);
$cap = Create_captcha ($vals);
echo $cap [' image '];
?>

The results of the operation are as follows:

It is hoped that this article will be helpful to the CI framework design of everyone.


How do I create a picture verification code using CI?

PHP has a lot of verification code class Ah! You can use it almost without modifying a class library as a CI. Google search php captcha view original posts >>

How do I create a picture verification code using CI?

PHP has a lot of verification code class Ah! You can use it almost without modifying a class library as a CI. Google search php captcha view original posts >>

http://www.bkjia.com/PHPjc/906672.html www.bkjia.com true http://www.bkjia.com/PHPjc/906672.html techarticle CI Framework Verification Code CAPTCHA Auxiliary function Usage example, Cicaptcha This article describes the CI Framework verification Code CAPTCHA Auxiliary function usage, share for everyone for reference. Specific as follows: to make ...

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.