我有使用代码点火器的电子邮件验证的URL,如下所示:
这是我的控制器,用来解密链接中的数据。
public function email_vertification($id_account, $ciphertext)
{
$account = $this->db->get_where('ms_account', ['id_account' => $id_account])->row_array();
echo $ciphertext."<br>";
echo $account['code'];
if ($ciphertext == $account['code'])
{
$dec_data = $this->decrypt($account['key'], $account['hmac_key'], $account['code']);
// this result will be null if I use ciphertext from the URL
var_dump($dec_data);
}
}我有两个选项,保存并使用数据库中的密文,或者使用URL中的密文。如果我使用URL中的密文,结果将为null,因为密文不一样。结果来自我的回声
fdf0b4b6ca1340cc1758555cafebbf0a836ba939454a4a250053a15b855909802307534eec2494564b4f1e3e47110a477993725f146ff3769892217f4818535aUcugLME3AoV4UffTdM
fdf0b4b6ca1340cc1758555cafebbf0a836ba939454a4a250053a15b855909802307534eec2494564b4f1e3e47110a477993725f146ff3769892217f4818535aUcugLME3AoV4UffTdM/U8T+cZ12MLMCjizPCqf0b4+bAgoQojQmobJnmhN5qSOUS5isbN0qPO6GujCxZT71C3Q==问题是,为什么我的URL中的密文会发生这种情况?以及为什么我不能从我的URL链接中得到我的密文。谢谢你,
发布于 2020-04-25 01:03:40
密文包含一个/。因此,Codeigniter将在/之后将文本理解为email_vertification()方法的下一个参数。
你可以试试
public function email_vertification($id_account, $ciphertext1,$ciphertext2)然后
if(($ciphertext1."/".$ciphertext2) == $account['code'])https://stackoverflow.com/questions/61412705
复制相似问题