This is a discussion on Dynamic Expires Meta tag within the PHP Language forums, part of the PHP Programming Forums category; Hi there, I have a database with documents that have event dates included. What I need to do is have ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hi there,
I have a database with documents that have event dates included. What I need to do is have the Expires META tag to be one day after that event date. Can I get the date from the appropriate field in the database and format it into GMT to add into the header() function? Cheers Steven |
|
|||
|
.oO(Steven)
>I have a database with documents that have event dates included. What I need >to do is have the Expires META tag to be one day after that event date. You don't need a meta-element, use an Expires header instead. >Can I get the date from the appropriate field in the database and format it >into GMT to add into the header() function? Yep. According to RFC 2616 (HTTP 1.1) the date has to be in a form like this to be valid for the Expires header: Thu, 01 Dec 1994 16:00:00 GMT Micha |
|
|||
|
Hi there,
Yes, sorry I meant the expires header. These documents used to be hand coded and so the expires date was update manually. What I need now is a way of populating the expires header with data from the database. Can this be done??? Cheers Steven "Michael Fesser" <netizen@gmx.net> wrote in message news:bhiom0t6iq7kph3oimmr2daodtq1ol5tol@4ax.com... > .oO(Steven) > > >I have a database with documents that have event dates included. What I need > >to do is have the Expires META tag to be one day after that event date. > > You don't need a meta-element, use an Expires header instead. > > >Can I get the date from the appropriate field in the database and format it > >into GMT to add into the header() function? > > Yep. According to RFC 2616 (HTTP 1.1) the date has to be in a form like > this to be valid for the Expires header: > > Thu, 01 Dec 1994 16:00:00 GMT > > Micha |
|
|||
|
.oO(Steven)
>What I need now is a way of populating the expires header with data from the >database. > >Can this be done??? Sure, just fetch your date from the database (as Unix timestamp if possible), format it with date() or strftime() and use the header() function to create the Expires header. Micha |