Content Expiration

Discussion in 'HTML' started by Sean, Jun 1, 2010.

  1. Sean

    Sean Guest

    I have some content on a web page that needs to expire on a certain
    date. I'm doing a promo that ends December 31st, 2010. I need a
    sentence in a paragraph to go away on January 1st, 2011.

    Example:
    Before Jan. 1, 2011:
    Dear guest, register to win a $250 gift card. Also, receive an HP
    laptop for free. Thank you!

    After Jan 1, 2011:
    Dear guest, register to win a $250 gift card. Thank you!
    Sean, Jun 1, 2010
    #1
    1. Advertising

  2. Sean

    rf Guest

    "Sean" <> wrote in message
    news:...
    >I have some content on a web page that needs to expire on a certain
    > date. I'm doing a promo that ends December 31st, 2010. I need a
    > sentence in a paragraph to go away on January 1st, 2011.
    >
    > Example:
    > Before Jan. 1, 2011:
    > Dear guest, register to win a $250 gift card. Also, receive an HP
    > laptop for free. Thank you!
    >
    > After Jan 1, 2011:
    > Dear guest, register to win a $250 gift card. Thank you!


    On the morning of January 1st, 2011 edit your web site and remove the
    offending sentence.
    rf, Jun 2, 2010
    #2
    1. Advertising

  3. Sean

    Doug Miller Guest

    In article <>, Sean <> wrote:
    >I have some content on a web page that needs to expire on a certain
    >date. I'm doing a promo that ends December 31st, 2010. I need a
    >sentence in a paragraph to go away on January 1st, 2011.


    There's no way to do that in HTML. If your content is generated dynamically on
    the server side (e.g. by PHP or ASP) then ask in a newsgroup germane to your
    server-side code.
    Doug Miller, Jun 2, 2010
    #3
  4. Sean

    cwdjrxyz Guest

    On Jun 1, 8:57 pm, (Doug Miller) wrote:
    > In article <>, Sean <> wrote:
    >
    > >I have some content on a web page that needs to expire on a certain
    > >date.  I'm doing a promo that ends December 31st, 2010.  I need a
    > >sentence in a paragraph to go away on January 1st, 2011.

    >
    > There's no way to do that in HTML. If your content is generated dynamically on
    > the server side (e.g. by PHP or ASP) then ask in a newsgroup germane to your
    > server-side code.


    It should be fairly simple using php if you have access to php on the
    server you are using. Php can give you information about the time and
    date including the time since a starting reference point a long time
    ago. Likely instead of the paragraph you wish to remove in the future,
    you will introduce a short php section. First it will find the current
    reference time. You will also need to calculate the reference time
    when you wish to delete or change the paragraph. The php script is
    written to see if the current reference time is greater than or less
    than the the cut off reference time. If less than, the php code then
    writes the paragraph you need before the cut off time. If equal or
    greater than, nothing is written, or you write something saying the
    offer is expired. The rest of your present html page would remain the
    same, except it would have to be named something.php instead of the
    present something.html. I have never done exactly this with php, and
    we do not have an online examle of your complete code. Thus I will not
    be more specific at this time. If you have access to php I suggest you
    post to comp.lang.php. Since you have a gmail address, I am guessing
    you post from Google Groups. If so go to http://groups.google.com/group/comp.lang.php/topics?hl=en
    .. and sign up for that group if you wish to post there.
    cwdjrxyz, Jun 2, 2010
    #4
  5. Sean

    Sean Guest

    On Jun 1, 6:57 pm, (Doug Miller) wrote:
    > In article <>, Sean <> wrote:
    >
    > >I have some content on a web page that needs to expire on a certain
    > >date.  I'm doing a promo that ends December 31st, 2010.  I need a
    > >sentence in a paragraph to go away on January 1st, 2011.

    >
    > There's no way to do that in HTML. If your content is generated dynamically on
    > the server side (e.g. by PHP or ASP) then ask in a newsgroup germane to your
    > server-side code.


    yeah, i don't have access to php on my server and asp is beyond me,
    it's pure html. that's what i needed to know.
    Sean, Jun 2, 2010
    #5
  6. Sean

    cwdjrxyz Guest

    On Jun 1, 11:53 pm, Sean <> wrote:
    > On Jun 1, 6:57 pm, (Doug Miller) wrote:
    >
    > > In article <>, Sean <> wrote:

    >
    > > >I have some content on a web page that needs to expire on a certain
    > > >date.  I'm doing a promo that ends December 31st, 2010.  I need a
    > > >sentence in a paragraph to go away on January 1st, 2011.

    >
    > > There's no way to do that in HTML. If your content is generated dynamically on
    > > the server side (e.g. by PHP or ASP) then ask in a newsgroup germane to your
    > > server-side code.

    >
    > yeah, i don't have access to php on my server and asp is beyond me,
    > it's pure html.  that's what i needed to know.


    Since php and other server side code is not possible for you, I will
    mention that you likely could do this with Javascript much I outlined
    for php. But Javascript can be turned off on a few computers and thus
    they would not change or delete the message at the time your offer
    expires. You can use a noscript path to desplay a message that script
    is turned off and that Javascript is required for the page. However
    the few people who have Javascript turned off for whatever reason may
    be annoyed by your script message. Many banks, etc. require
    Javascript, but someone is more likely to turn it on for them to be
    able to view their private information correctly.
    cwdjrxyz, Jun 2, 2010
    #6
  7. Sean

    Andy Dingley Guest

    On 1 June, 23:48, Sean <> wrote:
    > I have some content on a web page that needs to expire on a certain
    > date.  


    Change the content being served at this time.

    Before this (and quite importantly, before you even serve the offer
    page) set the HTTP response headers so that the first page isn't
    cached beyond that rollover date. You're best learning to set these
    through .htaccess or similar, if you're only using a static server.
    Otherwise serve them from your scripting language, or else (if forced
    to) <meta http-equiv ... > in your HTML pages (but check that these
    aren't being over-ridden by a real header coming from the server).

    Find yourself either an alarm clock, or some trivial PHP scripting, to
    handle the actual changeover.
    Andy Dingley, Jun 2, 2010
    #7

  8. >
    > On the morning of January 1st, 2011 edit your web site and remove the
    > offending sentence.


    That also takes care of any bugs in the code. I know I'm not
    confident enough to write truly bug free code.

    www.richardfisher.com
    Helpful person, Jun 2, 2010
    #8
  9. Sean

    .._.. Guest

    Depending on how the resource is manged:

    Make a batch / cron file on the server to over-write the file with one
    without the paragraph in it.

    Or, use the FTP scripting tools to make a batch file and command file that
    uploads a pre-prepared file from the home computer.

    Then trigger either of the above with the scheduler service approprate for
    the OS.

    "Andy Dingley" <> wrote in message
    news:...
    On 1 June, 23:48, Sean <> wrote:
    > I have some content on a web page that needs to expire on a certain
    > date.


    Change the content being served at this time.

    Before this (and quite importantly, before you even serve the offer
    page) set the HTTP response headers so that the first page isn't
    cached beyond that rollover date. You're best learning to set these
    through .htaccess or similar, if you're only using a static server.
    Otherwise serve them from your scripting language, or else (if forced
    to) <meta http-equiv ... > in your HTML pages (but check that these
    aren't being over-ridden by a real header coming from the server).

    Find yourself either an alarm clock, or some trivial PHP scripting, to
    handle the actual changeover.
    .._.., Jun 2, 2010
    #9
  10. ..._.. wrote:
    > Depending on how the resource is manged:


    Managed? ;-)

    > Make a batch / cron file on the server to over-write the file with one
    > without the paragraph in it. Or, use the FTP scripting tools to make
    > a batch file and command file that uploads a pre-prepared file from
    > the home computer.
    >
    > Then trigger either of the above with the scheduler service
    > approprate for the OS.


    It is, in this instance, far easier to simply remove the phrase " Also,
    receive an HP laptop for free. " and FTP up the new version when he
    comes home from the New Years Eve party. 10-15 seconds work?

    Please do not top-post.

    --
    -bts
    -Four wheels carry the body; two wheels move the soul
    Beauregard T. Shagnasty, Jun 2, 2010
    #10
  11. Sean

    Doug Miller Guest

    In article <hu61ai$cv7$-september.org>, "Beauregard T. Shagnasty" <> wrote:
    >..._.. wrote:
    >> Depending on how the resource is manged:

    >
    >Managed? ;-)


    Perhaps he meant "mangled". :-b
    >
    >> Make a batch / cron file on the server to over-write the file with one
    >> without the paragraph in it. Or, use the FTP scripting tools to make
    >> a batch file and command file that uploads a pre-prepared file from
    >> the home computer.
    >>
    >> Then trigger either of the above with the scheduler service
    >> approprate for the OS.

    >
    >It is, in this instance, far easier to simply remove the phrase " Also,
    >receive an HP laptop for free. " and FTP up the new version when he
    >comes home from the New Years Eve party. 10-15 seconds work?


    Unless he doesn't come home from that party until 6am.
    Unless he's too blasted or hung over to remember to do it.
    Unless...
    Unless...
    Unless...

    I like the idea of a cron job better. Computers don't get drunk or forget to
    do things.
    Doug Miller, Jun 2, 2010
    #11
  12. Sean

    123Jim Guest

    "Sean" <> wrote in message
    news:...
    >I have some content on a web page that needs to expire on a certain
    > date. I'm doing a promo that ends December 31st, 2010. I need a
    > sentence in a paragraph to go away on January 1st, 2011.
    >
    > Example:
    > Before Jan. 1, 2011:
    > Dear guest, register to win a $250 gift card. Also, receive an HP
    > laptop for free. Thank you!
    >
    > After Jan 1, 2011:
    > Dear guest, register to win a $250 gift card. Thank you!


    Whatever way you do it, you should probably display the message: 'offer
    expires at [time] on [date]' .. that way you don't need to be too concerned
    if the page remains available, in the visitors' cache
    123Jim, Jun 2, 2010
    #12
  13. cwdjrxyz wrote:

    > Since php and other server side code is not possible for you, I will
    > mention that you likely could do this with Javascript much I outlined
    > for php.


    It's fairly simple in JavaScript. Example:

    <div id="expires">Special offer: bla bla bla. This offer ends at the end of
    year 2010.</div>
    <script type="text/javascript">
    var expDate = new Date("December 31, 2010");
    var expElem = document.getElementById('expires');
    if(expElem) {
    var now = new Date();
    if(now > expDate) {
    expElem.innerHTML = ""; } }
    </script>

    I first thought of a more structured approach, using <del
    datetime="...">...</del>, but that's a bad idea, since when scripting is
    off, the content would be displayed in a manner that suggests that it has
    bee deleted (typically, with strike over). So it's better to use
    content-free markup like <div> or <span>.

    > But Javascript can be turned off on a few computers and thus
    > they would not change or delete the message at the time your offer
    > expires.


    That's not a serious problem if the content clearly says the expiry date.

    > You can use a noscript path to desplay a message that script
    > is turned off and that Javascript is required for the page. However
    > the few people who have Javascript turned off for whatever reason may
    > be annoyed by your script message.


    Indeed, and in a case like this, it would be really annoying since
    JavaScript would not really be _needed_ for viewing the page.

    --
    Yucca, http://www.cs.tut.fi/~jkorpela/
    Jukka K. Korpela, Jun 2, 2010
    #13
  14. Sean

    Doug Miller Guest

    In article <ytwNn.15441$>, "Jukka K. Korpela" <> wrote:
    >cwdjrxyz wrote:
    >
    >> Since php and other server side code is not possible for you, I will
    >> mention that you likely could do this with Javascript much I outlined
    >> for php.

    >
    >It's fairly simple in JavaScript.


    And if I have JS disabled?
    Doug Miller, Jun 2, 2010
    #14
  15. Doug Miller wrote:

    >> It's fairly simple in JavaScript.

    >
    > And if I have JS disabled?


    Did you actually read my message? I guess not. Please do so now. It
    specifically addressed the question you asked, before you even asked it.

    --
    Yucca, http://www.cs.tut.fi/~jkorpela/
    Jukka K. Korpela, Jun 2, 2010
    #15
  16. Sean

    SAZ Guest

    In article <hu61v8$huk$-september.org>,
    lid says...
    >
    > "Sean" <> wrote in message
    > news:...
    > >I have some content on a web page that needs to expire on a certain
    > > date. I'm doing a promo that ends December 31st, 2010. I need a
    > > sentence in a paragraph to go away on January 1st, 2011.
    > >
    > > Example:
    > > Before Jan. 1, 2011:
    > > Dear guest, register to win a $250 gift card. Also, receive an HP
    > > laptop for free. Thank you!
    > >
    > > After Jan 1, 2011:
    > > Dear guest, register to win a $250 gift card. Thank you!

    >
    > Whatever way you do it, you should probably display the message: 'offer
    > expires at [time] on [date]' .. that way you don't need to be too concerned
    > if the page remains available, in the visitors' cache


    That makes the most sense, and what I thought of when the OP first
    posted.

    "And if you register by 11:59pm on 12/31/10, you will also be entered
    for an opportunity to win an HP Laptop."
    SAZ, Jun 2, 2010
    #16
  17. Sean

    Neredbojias Guest

    On 02 Jun 2010, "123Jim" <> wrote:

    >
    > "Sean" <> wrote in message
    > news:.
    > ..
    >>I have some content on a web page that needs to expire on a certain
    >> date. I'm doing a promo that ends December 31st, 2010. I need a
    >> sentence in a paragraph to go away on January 1st, 2011.
    >>
    >> Example:
    >> Before Jan. 1, 2011:
    >> Dear guest, register to win a $250 gift card. Also, receive an HP
    >> laptop for free. Thank you!
    >>
    >> After Jan 1, 2011:
    >> Dear guest, register to win a $250 gift card. Thank you!

    >
    > Whatever way you do it, you should probably display the message:
    > 'offer expires at [time] on [date]' .. that way you don't need to be
    > too concerned if the page remains available, in the visitors' cache


    Yep. And that makes any cron job, certainly anything in javascript,
    overkill IYAM.

    --
    Neredbojias

    http://www.neredbojias.org/
    http://www.neredbojias.net/
    Neredbojias, Jun 4, 2010
    #17
  18. Neredbojias wrote:

    >> Whatever way you do it, you should probably display the message:
    >> 'offer expires at [time] on [date]' .. that way you don't need to be
    >> too concerned if the page remains available, in the visitors' cache

    >
    > Yep. And that makes any cron job, certainly anything in javascript,
    > overkill IYAM.


    Non sequitur.

    It is of course usually a good idea to explicitly mention the expiry time in
    page content, especially in a commercial context where this may greatly
    boost sales: people are urged to buy before it is too late.

    But wiping out the outdated content isn't overkill. You usually don't want
    to bother visitors with outdated content. In the worst case, they might get
    angry and frustrated and might refuse to buy any of the offers that are
    still valid.

    In such a context, the server admin has probably done his best to prevent
    caching of the page, for other reasons as well, for good or bad. There are
    still two reasons why it would not be overkill to have client-side
    Javascript that removes the content: the page might still be retrieved from
    cache for some reason (or accessed as a locally saved page); and the timed
    server-side job might fail (it happens, usually due to human errors e.g. in
    setting the dates, but still).

    --
    Yucca, http://www.cs.tut.fi/~jkorpela/
    Jukka K. Korpela, Jun 4, 2010
    #18
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Rudy Mark

    content expiration

    Rudy Mark, Oct 16, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    385
    Natty Gur
    Oct 16, 2003
  2. Mario Hébert

    IIS Enable content expiration and .Net objects

    Mario Hébert, Jan 7, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    2,478
  3. Daenil of GL

    Re: content expiration?

    Daenil of GL, Feb 25, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    538
    Daenil of GL
    Feb 25, 2004
  4. Replies:
    0
    Views:
    419
  5. TR
    Replies:
    0
    Views:
    554
Loading...

Share This Page