게시판 즐겨찾기
편집
드래그 앤 드롭으로
즐겨찾기 아이콘 위치 수정이 가능합니다.
php 쿠키 생성이 안되네요.
게시물ID : programmer_10782짧은주소 복사하기
작성자 : mmmmm5
추천 : 0
조회수 : 343회
댓글수 : 2개
등록시간 : 2015/06/03 20:40:55
<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!

이런 오류가 뜨네요. 왜 이러는 걸까요?
전체 추천리스트 보기
새로운 댓글이 없습니다.
새로운 댓글 확인하기
글쓰기
◀뒤로가기
PC버전
맨위로▲
공지 운영 자료창고 청소년보호