By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,718 Members | 1,438 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,718 IT Pros & Developers. It's quick & easy.

Last-modified?

P: n/a
Hi all,

I tried putting this at the beginning of a PHP file:

<?php
echo "Last-modified: " . date( "F d Y.", getlastmod() );
print "";
?>

The goal was to ensure that the browser would realize
that the page is newly produced HTML. However its not
working. The browser shows above the page the expression
Last-modified: ...

Can anyone explain how to properly do this?

Thanks.

Jan 30 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a


On Jan 29, 9:09 pm, "Rarpy" <Rexun...@yahoo.comwrote:
Hi all,

I tried putting this at the beginning of a PHP file:

<?php
echo "Last-modified: " . date( "F d Y.", getlastmod() );
print "";
?>
have you checked to see if getlastmod is actually returning a value?
>
The goal was to ensure that the browser would realize
that the page is newly produced HTML. However its not
working. The browser shows above the page the expression
Last-modified: ...

Can anyone explain how to properly do this?

Thanks.
Jan 30 '07 #2

P: n/a
Rarpy wrote:
Hi all,

I tried putting this at the beginning of a PHP file:

<?php
echo "Last-modified: " . date( "F d Y.", getlastmod() );
print "";
?>

The goal was to ensure that the browser would realize
that the page is newly produced HTML. However its not
working. The browser shows above the page the expression
Last-modified: ...

Can anyone explain how to properly do this?

Thanks.
If you're actually trying to send a header, you need to use the
header() function, not echo it out. Make sure you send the headers
before any output is sent.

See: http://php.net/header

--
Curtis
Jan 30 '07 #3

P: n/a
There is a good example of sending the last modified header on the
getlastmod doc page. Consider checking it out:

http://ca.php.net/manual/en/function...tmod.php#30514

On Jan 29, 11:09 pm, "Rarpy" <Rexun...@yahoo.comwrote:
Hi all,

I tried putting this at the beginning of a PHP file:

<?php
echo "Last-modified: " . date( "F d Y.", getlastmod() );
print "";
?>

The goal was to ensure that the browser would realize
that the page is newly produced HTML. However its not
working. The browser shows above the page the expression
Last-modified: ...

Can anyone explain how to properly do this?

Thanks.
Jan 30 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.