我知道上述错误意味着某些东西正在通过 HTTP 协议发送它的输出(如果我理解正确的话)。它给我错误的行是 setcookie 之一和标题之一(最后一个)。任何人都可以帮我解决这个问题吗?谢谢你。
<?php
$a = 'thisissomestring==';
$b = 'thisissomestring==';
$encryptedData = base64_decode($a);
$iv = base64_decode($b);
$appKey ='thisissomestring';
$td = mcrypt_module_open(MCRYPT_SERPENT, '', MCRYPT_MODE_CBC, '');
$ks = mcrypt_enc_get_key_size($td);
$key = substr($appKey, 0, $ks);
mcrypt_generic_init($td, $key, $iv);
$decrypted = mdecrypt_generic($td, $encryptedData);
$str = $decrypted;
mcrypt_generic_deinit($td);
mcrypt_module_close($td);
$file = file($decrypted);
$output = $file[0];
if( !isset( $_COOKIE['thisismycookie'] ) )
{
setcookie('thisismycookie', $output, time() + 600, "/", $_SERVER['HTTP_HOST']);
}
else
{
echo 'Action not allowed [3]';
die();
}
unset($file[0]);
file_put_contents($str, $file);
header("Location: http://www.mysite.com/something");
?>