为了账号安全,请及时绑定邮箱和手机立即绑定

为什么出现这种warning

welcome spark
用户信息加密前:a:5:{s:3:"uid";i:10000;s:4:"name";s:5:"spark";s:5:"email";s:15:"spark@imooc.com";s:3:"sex";s:3:"man";s:3:"age";s:2:"18";}
Warning: mcrypt_encrypt() [function.mcrypt-encrypt]: Attempt to use an empty IV, which is NOT recommend in F:\APMServ-v5.2.6\APMServ5.2.6\www\htdocs\cookie.php on line 139
用户信息加密后:N6fsF+gD21rkTnAmIJeI/Imbzlze9Sz2tFD/3fxoUTMNFJSq4fg+jjHaGTrpkZTWWBPHHt4IJ2V7rJCfnA3wiicjRgffYVPqNcMq26o+NJ5rdiOwYkuWzdVNm+9FQTyimlQDl6zsKNhj1nRKkTnF2Cr7NcMyXejh6+ZtG0Y0Yek=
Warning: Cannot modify header information - headers already sent by (output started at F:\APMServ-v5.2.6\APMServ5.2.6\www\htdocs\cookie.php:133) in F:\APMServ-v5.2.6\APMServ5.2.6\www\htdocs\cookie.php on line 142

Warning: mcrypt_decrypt() [function.mcrypt-decrypt]: Attempt to use an empty IV, which is NOT recommend in F:\APMServ-v5.2.6\APMServ5.2.6\www\htdocs\cookie.php on line 145
解密后的用户信息:
array(5) { ["uid"]=> int(10000) ["name"]=> string(5) "spark" ["email"]=> string(15) "spark@imooc.com" ["sex"]=> string(3) "man" ["age"]=> string(2) "18" }

正在回答

1 回答

mcrypt_encrypt/mcrypt_decrypt 函数的iv参数没有赋值,所以抛出warning,导致后面php的设置cookie函数失效(在header里面),再次抛出warning。iv参数的设置参考官网

0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消

为什么出现这种warning

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信