【问题标题】:encrypt password not working in codeigniter let me know where i'm wrong加密密码在codeigniter中不起作用让我知道我错在哪里
【发布时间】:2015-04-04 21:42:30
【问题描述】:

控制器

 $this->load->library('encrypt');
 $this->form_validation->set_rules('dpassword', 'Password','required|trim');
 $data=array('code goes here');
 $this->encrypt->encode($data);

但是在 phpmyadmin 中密码不会被加密。如果你有一些解决方案。我确实在配置文件中更改了加密密钥。

【问题讨论】:

    标签: codeigniter encryption phpmyadmin


    【解决方案1】:

    您必须设置一个加密密钥并将其作为编码函数的第二个参数传递。例如:

     $this->load->library('encrypt');
     $this->form_validation->set_rules('dpassword', 'Password','required|trim');
     $data=array('code goes here');
    
     $key = 'super-secret-key'; //Your Encryption key
    
     $this->encrypt->encode($data,$key);
    

    试试这个..它可能会解决你的问题

    【讨论】:

    • 解析错误:语法错误,意外'$this' (T_VARIABLE)
    • 遇到 PHP 错误 严重性:警告消息:mcrypt_encrypt() 需要参数 3 为字符串,数组给定文件名:libraries/encrypt.php
    • 我不知道在哪里可以找到这个文件我的库中没有任何东西需要 index.php 文件
    • 您正在将一个数组传递给 $this->encrypt->encode()。 encode() 方法接受一个字符串。
    • 我可以知道您使用 $data 传递的数据是什么
    猜你喜欢
    • 1970-01-01
    • 2023-03-30
    • 2017-11-10
    • 2015-07-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多