my website was running fine but now i am having the problem shows
Warning: Cannot modify header information - headers already sent by (output started at /home/content/n/e/l/nelgo1/html/nelgosecurity/secure/nsa/submenucontents.php:3) in /home/content/n/e/l/nelgo1/html/nelgosecurity/secure/nsa/submenucontents.php on line 22
where in line no 22 i see
header("Location: http://www.xxx.com/xxx/xxx.php");
please specify me a solution
header() Cannot modify header information - headers already
Moderator: General Moderators
-
lokesh_kumar_s
- Forum Commoner
- Posts: 48
- Joined: Mon Apr 13, 2009 5:39 am
- Contact:
Re: header() Cannot modify header information - headers already
You can't echo or print anything before you call header(). So fix the code so that doesn't happen.
Re: header() Cannot modify header information - headers already
you must have had an echo or print statement in line 3 of the same file which resulted in this error.
Re: header() Cannot modify header information - headers already
I had a similar problem on one of my websites. Try to throw this code into it:
This will tell you where in your code the headers were already sent from and what line it was on. Hope this helps.
Code: Select all
if(headers_sent($file, $line)){
// ... where were the mysterious headers sent from?
echo "Headers were already sent in $file on line $line...";
}