2015-02-05 38 views
0

控制器加密密碼,讓我知道我錯了

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

但在phpMyAdmin密碼不會得到encrypted.if你有that.i一些解決方案確實使加密密鑰的變化在配置文件中。

回答

0

您必須設置一個加密密鑰並將其作爲編碼函數的第二個參數傳遞。例如:

$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); 

剛剛嘗試這一點。它可能會解決你的問題

+0

解析錯誤:語法錯誤,意外「$這一」(T_VARIABLE) –

+0

檢查您是否錯過任何分號.. –

+0

一個PHP錯誤遇到 嚴重性:警告 消息:mcrypt_encrypt()預計參數3是字符串,數組給定 文件名:庫/ encrypt.php –

相關問題