473,387 Members | 1,501 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Last-modified?

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
3 1854


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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: SimonC | last post by:
I would like to return data from the last 2 weeks of each given month in Javascript, but in 2 formats. So, the penultimate week (Monday to Sunday) and the last week (Monday to ??) I'm not...
7
by: Scott W Gifford | last post by:
Hello, I'm considering using XML to represent a stream of location information, and XPath to do queries against it. I've got most of it figured out (at least on paper), but I can't figure out...
3
by: AndyBell | last post by:
Hi all! I have an Access 2000 database for the Habiat for Humanity where I work. This is the second database I have written and it gets a bit more complex each time... I have learned much and...
32
by: James Curran | last post by:
I'd like to make the following proposal for a new feature for the C# language. I have no connection with the C# team at Microsoft. I'm posting it here to gather input to refine it, in an "open...
2
by: rf | last post by:
Hey I need to be able to get the dates from last wednesday to the past tuesday on thursday or friday every week. How would I do that? For example: m t W TH F M T w th f I would need the...
17
by: michel.ank | last post by:
Hi, I'm using the class PrintLines and my last record of page aren't with the borders. Somebody can help me? Thanks,
6
by: magix | last post by:
Hi, when I read entries in file i.e text file, how can I determine the first line and the last line ? I know the first line of entry can be filtered using counter, but how about the last line...
2
by: Kevin Burton | last post by:
I don't think I understand the last() function. I have a document that looks like: <Root> <Header>Some text</Header> <Message> <MessageID>1</MessageID> . . . . </Message>
13
by: Greg | last post by:
Most suggestions on this topic recommend to use a page footer and make it visible only on the last page. My problem is that the footer is half of the height of a page which means the detail would...
23
by: Florian Lindner | last post by:
Hello, can I determine somehow if the iteration on a list of values is the last iteration? Example: for i in : if last_iteration: print i*i else:
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.