<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>setcookie( ) 함수를 이용한 쿠키 생성</title>
</head>
<body>
<?
setcookie("user", "Alex Porter", time() + 3600);
if (isset($_COOKIE["user"])) {
echo "Welcome " . $_COOKIE["user"] . "!<br/>";
} else {
echo "Welcome guest!<br/>";
}
?>
</body>
</html>
이렇게 작성했는데
Warning: Cannot modify header information - headers already sent by (output started at C:\APM_Setup\htdocs\test.php:7) inC:\APM_Setup\htdocs\test.php on line 8
Welcome guest!
이런 오류가 뜨네요. 왜 이러는 걸까요?