그누보드 index.php 로 접속하면 mytext 게시판의 최신글로 가기 정보
그누보드 index.php 로 접속하면 mytext 게시판의 최신글로 가기본문
블로그처럼 하려고합니다...
그누보드의 index.php 로 접속을 하면 mytext 게시판의 최신글로 자동으로 넘어가게하려고 합니다..
아래소스는 제로보드에서 갖다가 바꿔보려고 한건데요...
오류가 뜹니다..
고수님들의 조언 부탁드립니다..
if(!$wr_num) {
$max_num = mysql_fetch_array(mysql_query("select max(wr_num) from g4_write_mytext where wr_option!='secret'"));
header("location:http://".$_SERVER[HTTP_HOST]."&wr_id=".$max_num[0]);
exit;
}
오류메세지는
Warning: Cannot modify header information - headers already sent by (output started at /web/home/OOOOOO/html/head.sub.php:52) in /web/home/dufao/html/index.php on line 16
16번째라인은
header("location:http://".$_SERVER[HTTP_HOST]."&wr_id=".$max_num[0]);
입니다.
그누보드의 index.php 로 접속을 하면 mytext 게시판의 최신글로 자동으로 넘어가게하려고 합니다..
아래소스는 제로보드에서 갖다가 바꿔보려고 한건데요...
오류가 뜹니다..
고수님들의 조언 부탁드립니다..
if(!$wr_num) {
$max_num = mysql_fetch_array(mysql_query("select max(wr_num) from g4_write_mytext where wr_option!='secret'"));
header("location:http://".$_SERVER[HTTP_HOST]."&wr_id=".$max_num[0]);
exit;
}
오류메세지는
Warning: Cannot modify header information - headers already sent by (output started at /web/home/OOOOOO/html/head.sub.php:52) in /web/home/dufao/html/index.php on line 16
16번째라인은
header("location:http://".$_SERVER[HTTP_HOST]."&wr_id=".$max_num[0]);
입니다.
댓글 전체
ob_start();
header("location:http://".$_SERVER[HTTP_HOST]."&wr_id=".$max_num[0]);
이걸 테스트해보세요
header("location:http://".$_SERVER[HTTP_HOST]."&wr_id=".$max_num[0]);
이걸 테스트해보세요
if(!$wr_num) {
$max_num = mysql_fetch_array(mysql_query("select max(wr_num) from g4_write_dt_mytext where wr_option!='secret'"));
ob_start();
header("location:http://".$_SERVER[HTTP_HOST]."&wr_id=".$max_num[0]);
exit;
}
이렇게 했는데 똑같은 줄에서 오류뜨네요...
답변감사합니다..
$max_num = mysql_fetch_array(mysql_query("select max(wr_num) from g4_write_dt_mytext where wr_option!='secret'"));
ob_start();
header("location:http://".$_SERVER[HTTP_HOST]."&wr_id=".$max_num[0]);
exit;
}
이렇게 했는데 똑같은 줄에서 오류뜨네요...
답변감사합니다..
원인 : head.sub.php에 포함된 header정보와 index.php에서
지정하고자 하는 최신글 넘겨주기 구문의 header정보가 겹침.
해결 : head.sub.php를 참조하지 않기, 또는 goto_url 펑션 사용(추천 방법)
header로 전송하지 마시고,
goto_url 함수를 사용하시기 바랍니다.
/lib/common.lib.php 67라인 ~ 69라인 정도에서,
header로 URL을 넘겨주는 방식을
오래전에 goto_url 펑션으로 대체한 적이 있습니다.
// 메타태그를 이용한 URL 이동
// header("location:URL") 을 대체
function goto_url($url)
굳이 기존 방식으로 하고자 하신다면,
header정보를 포함하고 있는 head.sub.php를
참조(또는 첨부, include_once)시키지 말고,
테스트용 index.php를 만들어서 테스트 하시기 바랍니다.
지정하고자 하는 최신글 넘겨주기 구문의 header정보가 겹침.
해결 : head.sub.php를 참조하지 않기, 또는 goto_url 펑션 사용(추천 방법)
header로 전송하지 마시고,
goto_url 함수를 사용하시기 바랍니다.
/lib/common.lib.php 67라인 ~ 69라인 정도에서,
header로 URL을 넘겨주는 방식을
오래전에 goto_url 펑션으로 대체한 적이 있습니다.
// 메타태그를 이용한 URL 이동
// header("location:URL") 을 대체
function goto_url($url)
굳이 기존 방식으로 하고자 하신다면,
header정보를 포함하고 있는 head.sub.php를
참조(또는 첨부, include_once)시키지 말고,
테스트용 index.php를 만들어서 테스트 하시기 바랍니다.
음... 어렵군요...
고수님들이 팁으로 올려주시기전에는 사용하기 어렵겠습니다...
php 는 초보라서...
두분 답변감사합니다.
고수님들이 팁으로 올려주시기전에는 사용하기 어렵겠습니다...
php 는 초보라서...
두분 답변감사합니다.