开发者

"header already sent" error caused be detect_unicode="0"

开发者 https://www.devze.com 2023-04-11 03:32 出处:网络
I know that the \"header already sent\" error question was already answered millions of times, but I\'m a little stumped with this one.

I know that the "header already sent" error question was already answered millions of times, but I'm a little stumped with this one.

<?php
    session_start();
    if(isset($_GET['logout'])) {
        if($_GET['logout'] == 'logout')
            $past = time() - 10; 
        setcookie('hebron_member', date("F jS - g:i a"), $past);
    } else if(isset($_GET['setcookie'])) {
        if($_GET['setcookie'] == '1'){
            $month = 2592000 + time();
            setcookie('hebron_member', $_GET['id'], $month);
        }
    }
?>

That is at the top开发者_C百科 of my index page. When I transferred all my files to the webserver via Filezilla, the Korean characters were showing up as question marks. I did some research and saw that I could change the php.ini file to include detect_unicode="0", which fixed the problem, but since I've added that line, I get a "Cannot send session cache limiter" error.

Any suggestions?


be sure to save your files in UTF-8 without BOM

you can do it by using Notepad++ and save it as UTF-8 encoding without BOM =)


A very common and annoying problem is having a whitespace or line before the PHP opening tag

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号