Warning: session_register(): Cannot send session cache limiter - headers already sent
해결책:
우선
session_start();를 썼는지 봐야한다.
session.auto_start가 default값이 off이다.
다음 아래 문장을 참고.
You have to set the cookie before you send any HTML. setcookie() defines a cookie to be sent along with the rest of the header information. Cookies must be sent before any other headers are sent (this is a restriction of cookies, not PHP). This requires you to place calls to this function before any <html> or <head> tags.
Most common reason for this error is extra empty lines at the end of your php file. Delete those, and the error should not appear, as long as you have not made any other errors within your script. So check for empty lines before and after your PHP tags <?php or <? tag in db_connect.php that will cause such errors. Try to add @ before function names when calling and you don't want warnings & notices printout.
In advance, Generally you cannot echo anything BEFORE you register a session (I repeat - if its behaviour is similar to cookie). If you want to register a cookie, you must call the SetCookie procedure before that echo. And this seems to be simmilar problem. You use echo so HTTP Headers are sent and the session registration will fail. You have to set session_start(), session_register('username'); first before the echo and also you need to make sure the cookies/sessions are enabled and output_buffering= On in your php.ini file
"쇼핑몰·홈페이지·오픈마켓
블로그·페이스북·이메일 등의 각종 마케팅 글쓰기, 각종 광고, 영업, 판매, 제안서, 전단지 반응율 3배×10배 이상 높이는 마법의 8단계 공식" |
☞자세히보기 |
|
|