Hello,
I googled about this problem and there are some suggestion to handle this.
i have tried but none solve my problem.
Errors are shown in line 3, 4 an 5 which code is like below:

ob_start(); 
//stop caching
header("Pragma: no-cache");
header("Cache: no-cache");
session_start();

can anyone help me with this

thank you
Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\LessonPlan5\view.php:2) in C:\xampp\htdocs\LessonPlan5\constants.php on line 5

Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\LessonPlan5\view.php:2) in C:\xampp\htdocs\LessonPlan5\constants.php on line 6

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:\xampp\htdocs\LessonPlan5\view.php:2) in C:\xampp\htdocs\LessonPlan5\constants.php on line 7

Recommended Answers

All 3 Replies

The message shows two different modules: view.php and constants.php. You have only shown code for one of them (presumably constants.php). You are probably doing an include for view.php and it appears that you are generating some kind of output from that module. Any kind of output prior to using a header statement will create an error. This can be as simple as a blank line. Anything at all will do it.

thanks for all suggestions.
I followed Chrishea's , and it works.

thanks again

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.