Example of the CI framework Verification Code CAPTCHA auxiliary function usage, cicaptcha
This article describes how to use the CAPTCHA helper function of the CI framework verification code and shares it with you for your reference. The details are as follows:
The CAPTCHA helper function is used to conveniently generate verification codes. However, the images are stored in folders rather than output streams, and they are not perfect enough for use.
Note: four random numbers are generated. The captcha folder is created under the CI root directory.
Copy codeThe Code is as follows: <? Php
$ This-> load-> helper ('captcha ');
$ Vals = array (
'Word' => rand (1000,100 00 ),
'Img _ path' => './captcha /',
'Img _ url' => 'HTTP: // localhost/ci/captcha /',
// 'Font _ path' => './path/to/fonts/texb. ttf ',
'Img _ width' => '000000 ',
'Img _ height' => 30,
'Expiration' => 7200
);
$ Cap = create_captcha ($ vals );
Echo $ cap ['image'];
?>
Shows the running result:
I hope this article will help you with CI framework programming.
How can I use ci to create an image verification code?
PHP has many verification codes! You do not need to modify it as a class library of CI. Google search for php captcha to view the original post>
How can I use ci to create an image verification code?
PHP has many verification codes! You do not need to modify it as a class library of CI. Google search for php captcha to view the original post>