Monday, 28 August 2017

php - include header page session error




I have a header page which includes navbar and necessary css's, js's.



I'm trying call the header page from contact page but there was something going wrong.



I take this error on the contact page.




  • Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at C:\xampp\htdocs\test\includes\header.php:84) in C:\xampp\htdocs\test\contact.php on line 3




following the contact page codes.



include_once ("includes/header.php");
session_start();
require_once'includes/phpmailer/security.php';
?>







message sent



message failed







>



>





















header.php folder path--> C:\xampp\htdocs\test\includes\header.php



contact.php folder path --> C:\xampp\htdocs\test\contact.php


Answer




Most likely issue is that the includes/config.php or includes/header.php is outputting something to the browser - probably white space.



If these files have a closing PHP tag ?>, removing them should help solve the issue. Also make sure none of the files are using echo or print or other output functions.


No comments:

Post a Comment

casting - Why wasn't Tobey Maguire in The Amazing Spider-Man? - Movies & TV

In the Spider-Man franchise, Tobey Maguire is an outstanding performer as a Spider-Man and also reprised his role in the sequels Spider-Man...