zoukankan      html  css  js  c++  java
  • Atitit 验证码功能修复总结文档原有的tp5里面的验证码不知怎么有问题了,试图在tp5框架内修复无果。。使用了新的验证码组件 “lifei6671/php-captcha“: “0.

    Atitit 验证码功能修复总结文档

    原有的tp5里面的验证码不知怎么有问题了,试图在tp5框架内修复无果。。

    使用了新的验证码组件  "lifei6671/php-captcha": "0.1.*"

    //C:wampinphpphp5.6.31php.exe composer.phar update

    更新下载类库

    注意事项

    Session获取不到需要sesion start()开启session

    Ui界面验证码获取不到,需要看下是否type为text如果为num,会忽略。。取到空。。

    开启errorlog日之后,在C:wamplogsphp_error.log  读取日志。。对比。。

    主体code

    <?php
    //   /sdk/catchImg.php
    require __DIR__ . '/../vendor/autoload.php';
    use MinhoCaptchaCaptchaBuilder;

    session_start();
    $captch = new CaptchaBuilder();

    $captch->initialize([
        'width' => 120,     // 宽度
        'height' => 40,     // 高度
        'line' => false,    // 直线
        'curve' => true,    // 曲线
        'noise' => 1,       // 噪点背景
        'fonts' => []       // 字体
    ]);
    //  C:wampinphpphp5.6.31php.exe composer.phar install
    //C:wampinphpphp5.6.31php.exe composer.phar update
    $captch->create();
    $captch->save('778.png',1);
    $_SESSION['captch77'] = $captch->getText();

    error_log('$_SESSION[captch77] from ctimg.php '.$_SESSION['captch77']);

    $captch->output(1);
    //echo $captch->getText();

  • 相关阅读:
    Lintcode: Two Strings Are Anagrams
    Leetcode: House Robber
    Leetcode: Binary Tree Right Side View
    Leetcode: Number of Islands
    Lintcode: Subarray Sum
    Lintcode: Sort Letters by Case
    Lintcode: Sort Colors II
    Lintcode: Single Number III
    Lintcode: Search Range in Binary Search Tree
    Lintcode: Binary Tree Serialization (Serialization and Deserialization Of Binary Tree)
  • 原文地址:https://www.cnblogs.com/attilax/p/15196788.html
Copyright © 2011-2022 走看看