Dynamic Expires Meta tag

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 ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 10-12-2004
Steven
 
Posts: n/a
Default Dynamic Expires Meta tag

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


Reply With Quote
  #2 (permalink)  
Old 10-12-2004
Michael Fesser
 
Posts: n/a
Default Re: Dynamic Expires Meta tag

.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
Reply With Quote
  #3 (permalink)  
Old 10-12-2004
Steven
 
Posts: n/a
Default Re: Dynamic Expires Meta tag

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



Reply With Quote
  #4 (permalink)  
Old 10-13-2004
Michael Fesser
 
Posts: n/a
Default Re: Dynamic Expires Meta tag

.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
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 07:37 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0