테스트 사이트 - 개발 중인 베타 버전입니다

로그인 연동 헤더에러 질문드립니다. 채택완료

putty 9년 전 조회 4,057

회사에서 자체적으로 php날 코딩으로 만들어진 사이트를 갖고 있는데요

그누보드 게[시판을 쓰려고 회사db에 그누보드를 설치 했습니다.

 

root/company 에 회사 내부시스템이 설치되어있고

root/include에 있는 head.php 를 inclue 해와서 쿠키정보를 변수에 담아 로그인 정보를 사용하고있습니다. 

그리고 제가

root/gnuboard 에 그누보드를 설치 했습니다.

 

그누보드 설치후에 index.php에서 root/include에 있는 head.php를 

include "../include/head.php";

include "../include/head_sub.php";

이렇게 가져왔습니다.

 

그런데 아래와 같이 에러가 납니다.

 

------------------------------------------------------------------------------------------------------------

 

Warning: Cannot modify header information - headers already sent by (output started at /home/root/gnuboard/index.php:1) in /home/root/gnuboard/common.php on line 8

 

Warning: Cannot modify header information - headers already sent by (output started at /home/root/gnuboard/index.php:1) in /home/root/gnuboard/common.php on line 620

 

Warning: Cannot modify header information - headers already sent by (output started at /home/root/gnuboard/index.php:1) in /home/root/gnuboard/common.php on line 622

 

Warning: Cannot modify header information - headers already sent by (output started at /home/root/gnuboard/index.php:1) in /home/root/gnuboard/common.php on line 623

 

Warning: Cannot modify header information - headers already sent by (output started at /home/root/gnuboard/index.php:1) in /home/root/gnuboard/common.php on line 624

 

Warning: Cannot modify header information - headers already sent by (output started at /home/root/gnuboard/index.php:1) in /home/root/gnuboard/common.php on line 625

 

Warning: Cannot modify header information - headers already sent by (output started at /home/root/gnuboard/index.php:1) in /home/root/gnuboard/common.php on line 626

 

------------------------------------------------------------------------------------------------------------

 

헤더정보가 충돌을 일으킨거 같은데

여기서 어떤방법으로 include에 있는 head를 가져와서 

거기에서 사용한 세션 정보를 사용할수 있는지 궁금합니다.

 

요약하자면

1. 원래 회사에서 사용하던 로그인 세션정보를 그누보드에서 그대로 사용하려고합니다.

2. /root/incldue에 있는 head.php를 그누보드에 index.php에 include해서 로그인정보를 불러오려고 하는데 그누보드에서 저런 오류를 보여주고 있습니다.

 

댓글을 작성하려면 로그인이 필요합니다.

답변 1개

채택된 답변
+20 포인트
p
9년 전

index.php 파일에 추가하지 마시고 head.sub.php 파일에서 태그 시작전에 include 코드 넣어보세요. 

로그인 후 평가할 수 있습니다

답변에 대한 댓글 2개

p
putty
9년 전
/root/gnuboard/head.sub.php 에서 html 시작전에
include "../include/head.php";
include "../include/head_sub.php";
코드를 넣어봤는데 똑같은 에러가 발생하고 있습니다;
p
putty
9년 전
common.php 에서 아래부분에 추가해서 처리 하니 에러가 발생 안하네요.
조언 감사합니다. ^^

댓글을 작성하려면 로그인이 필요합니다.

답변을 작성하려면 로그인이 필요합니다.

로그인