고수님들 이 문제 좀 봐주실래요. 정보
고수님들 이 문제 좀 봐주실래요.본문
index.php 에 아래와 같이 넣어두었습니다. 도메인에 따라 다른 홈피가 뜨는 것이지요. 아래 코딩은 검증이 된거구요. 제가 다른 서버에서도 이렇게 사용하거든요.
<?
if ($_SERVER[HTTP_HOST]=="www.kkk.net") { $index="index1.html"; }
elseif ($_SERVER[HTTP_HOST]=="kkk.net") { $index="index1.html"; }
elseif ($_SERVER[HTTP_HOST]=="www.kkk.com") { $index="index2.html"; }
elseif ($_SERVER[HTTP_HOST]=="kkk.com") { $index="index2.html"; }
?>
<? include $index; ?>
하지만 kkk.net으로 접속시 아래와 같이 에러가 납니다. 그런데 kkk.net/index1.html 이렇게 주소를 직접 치면 에러가 없습니다. 무엇이 문제일까요?
Warning: Cannot modify header information - headers already sent by (output started at /home/hosting_users/homeschooler/www/index.php:13) in /home/hosting_users/homeschooler/www/common.php on line 8
Warning: Cannot modify header information - headers already sent by (output started at /home/hosting_users/homeschooler/www/index.php:13) in /home/hosting_users/homeschooler/www/lib/common.lib.php on line 98
Warning: Cannot modify header information - headers already sent by (output started at /home/hosting_users/homeschooler/www/index.php:13) in /home/hosting_users/homeschooler/www/lib/common.lib.php on line 98
Warning: Cannot modify header information - headers already sent by (output started at /home/hosting_users/homeschooler/www/index.php:13) in /home/hosting_users/homeschooler/www/lib/common.lib.php on line 98
Warning: Cannot modify header information - headers already sent by (output started at /home/hosting_users/homeschooler/www/index.php:13) in /home/hosting_users/homeschooler/www/head.sub.php on line 32
Warning: Cannot modify header information - headers already sent by (output started at /home/hosting_users/homeschooler/www/index.php:13) in /home/hosting_users/homeschooler/www/head.sub.php on line 34
Warning: Cannot modify header information - headers already sent by (output started at /home/hosting_users/homeschooler/www/index.php:13) in /home/hosting_users/homeschooler/www/head.sub.php on line 35
Warning: Cannot modify header information - headers already sent by (output started at /home/hosting_users/homeschooler/www/index.php:13) in /home/hosting_users/homeschooler/www/head.sub.php on line 36
Warning: Cannot modify header information - headers already sent by (output started at /home/hosting_users/homeschooler/www/index.php:13) in /home/hosting_users/homeschooler/www/head.sub.php on line 37
Warning: Cannot modify header information - headers already sent by (output started at /home/hosting_users/homeschooler/www/index.php:13) in /home/hosting_users/homeschooler/www/head.sub.php on line 38
<?
if ($_SERVER[HTTP_HOST]=="www.kkk.net") { $index="index1.html"; }
elseif ($_SERVER[HTTP_HOST]=="kkk.net") { $index="index1.html"; }
elseif ($_SERVER[HTTP_HOST]=="www.kkk.com") { $index="index2.html"; }
elseif ($_SERVER[HTTP_HOST]=="kkk.com") { $index="index2.html"; }
?>
<? include $index; ?>
하지만 kkk.net으로 접속시 아래와 같이 에러가 납니다. 그런데 kkk.net/index1.html 이렇게 주소를 직접 치면 에러가 없습니다. 무엇이 문제일까요?
Warning: Cannot modify header information - headers already sent by (output started at /home/hosting_users/homeschooler/www/index.php:13) in /home/hosting_users/homeschooler/www/common.php on line 8
Warning: Cannot modify header information - headers already sent by (output started at /home/hosting_users/homeschooler/www/index.php:13) in /home/hosting_users/homeschooler/www/lib/common.lib.php on line 98
Warning: Cannot modify header information - headers already sent by (output started at /home/hosting_users/homeschooler/www/index.php:13) in /home/hosting_users/homeschooler/www/lib/common.lib.php on line 98
Warning: Cannot modify header information - headers already sent by (output started at /home/hosting_users/homeschooler/www/index.php:13) in /home/hosting_users/homeschooler/www/lib/common.lib.php on line 98
Warning: Cannot modify header information - headers already sent by (output started at /home/hosting_users/homeschooler/www/index.php:13) in /home/hosting_users/homeschooler/www/head.sub.php on line 32
Warning: Cannot modify header information - headers already sent by (output started at /home/hosting_users/homeschooler/www/index.php:13) in /home/hosting_users/homeschooler/www/head.sub.php on line 34
Warning: Cannot modify header information - headers already sent by (output started at /home/hosting_users/homeschooler/www/index.php:13) in /home/hosting_users/homeschooler/www/head.sub.php on line 35
Warning: Cannot modify header information - headers already sent by (output started at /home/hosting_users/homeschooler/www/index.php:13) in /home/hosting_users/homeschooler/www/head.sub.php on line 36
Warning: Cannot modify header information - headers already sent by (output started at /home/hosting_users/homeschooler/www/index.php:13) in /home/hosting_users/homeschooler/www/head.sub.php on line 37
Warning: Cannot modify header information - headers already sent by (output started at /home/hosting_users/homeschooler/www/index.php:13) in /home/hosting_users/homeschooler/www/head.sub.php on line 38
댓글 전체
header가 이미 출력되었다는 의미인데요?
위치를 잘 넣으셔야 합니다..
위치를 잘 넣으셔야 합니다..
제가 이상한 것은 kkk.net을 칠 경우에만 에러가 난다는 겁니다. kkk.net/index1.html 이렇게 직접 치면 에러가 안 나거든요. 어떻게 해야할지..
오류가 안나는건 당연한거 아닌가요?
그쪽엔
<?
if ($_SERVER[HTTP_HOST]=="www.kkk.net") { $index="index1.html"; }
elseif ($_SERVER[HTTP_HOST]=="kkk.net") { $index="index1.html"; }
elseif ($_SERVER[HTTP_HOST]=="www.kkk.com") { $index="index2.html"; }
elseif ($_SERVER[HTTP_HOST]=="kkk.com") { $index="index2.html"; }
?>
이 코드를 부르지 않을테니까요...
조치사항은 위처럼, 위치를 잘 바꿔보는 수밖엔 없습니다.
제가 풀 코드를 가지고 있는것도 아닌이상 더이상 답변을 드릴수는 없겠네요.
그쪽엔
<?
if ($_SERVER[HTTP_HOST]=="www.kkk.net") { $index="index1.html"; }
elseif ($_SERVER[HTTP_HOST]=="kkk.net") { $index="index1.html"; }
elseif ($_SERVER[HTTP_HOST]=="www.kkk.com") { $index="index2.html"; }
elseif ($_SERVER[HTTP_HOST]=="kkk.com") { $index="index2.html"; }
?>
이 코드를 부르지 않을테니까요...
조치사항은 위처럼, 위치를 잘 바꿔보는 수밖엔 없습니다.
제가 풀 코드를 가지고 있는것도 아닌이상 더이상 답변을 드릴수는 없겠네요.
위에서 index1.html을 index1.php로 셋팅하고 이 파일 안에 아래 코딩을 넣어 index1.html을 부르게 했더니 에러코드가 나오지 않네요. 이렇게 해결봤습니다. ^^
감사합니다.
<frameset rows='*' border='0'>
<frame name='frame' src='http://kkk.net/index1.html'>
</frameset>
감사합니다.
<frameset rows='*' border='0'>
<frame name='frame' src='http://kkk.net/index1.html'>
</frameset>
그렇게 하는 것보다 index.php 만 수정 하는게 좋을 것입니다
아래와 같이 모든 공백 라인만 삭제하면 될 겁니다
<?
<----------- 공백라인 삭제
if ($_SERVER[HTTP_HOST]=="www.kkk.net") { $index="index1.html"; }
<------ 공백라인 삭제
?>
<------ 공백라인 삭제
아래와 같이 모든 공백 라인만 삭제하면 될 겁니다
<?
<----------- 공백라인 삭제
if ($_SERVER[HTTP_HOST]=="www.kkk.net") { $index="index1.html"; }
<------ 공백라인 삭제
?>
<------ 공백라인 삭제
공백 모두 삭제하고 해봤는데 안되네요.