Problem with Headers

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
sj1983msh
Forum Newbie
Posts: 15
Joined: Thu Feb 28, 2008 12:01 pm

Problem with Headers

Post by sj1983msh »

Hi every body,

I have faced a problem with sending header to the browser.
I have written a block of code which sends some headers to the browser, but when I run the script in order to test the result, then I receive a Warning which refers to the multiple header sending to the browser.
Is my script not gonna work?! Is just a simple warning that PHP shows me!
This is my CODE Block :


// Date in the past
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
// always modified
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
// HTTP/1.1
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
// HTTP/1.0
header("Pragma: no-cache");
// send the content type header so the image is displayed properly
header('Content-type: image/gif');


Please Help me to get rid of.

Sincerely Yours
Saman J.
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Re: Problem with Headers

Post by Kieran Huggins »

is it because of your two cache-control headers? don't know if that's legal or not, but that seems like the most likely source of your error.
Post Reply