Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Content Expiration

Reply
Thread Tools

Content Expiration

 
 
Sean
Guest
Posts: n/a
 
      06-01-2010
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!
 
Reply With Quote
 
 
 
 
rf
Guest
Posts: n/a
 
      06-01-2010

"Sean" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>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.


 
Reply With Quote
 
 
 
 
Doug Miller
Guest
Posts: n/a
 
      06-02-2010
In article <(E-Mail Removed)>, Sean <(E-Mail Removed)> 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.
 
Reply With Quote
 
cwdjrxyz
Guest
Posts: n/a
 
      06-02-2010
On Jun 1, 8:57*pm, (E-Mail Removed) (Doug Miller) wrote:
> In article <(E-Mail Removed)>, Sean <(E-Mail Removed)> 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....p/topics?hl=en
.. and sign up for that group if you wish to post there.
 
Reply With Quote
 
Sean
Guest
Posts: n/a
 
      06-02-2010
On Jun 1, 6:57*pm, (E-Mail Removed) (Doug Miller) wrote:
> In article <(E-Mail Removed)>, Sean <(E-Mail Removed)> 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.
 
Reply With Quote
 
cwdjrxyz
Guest
Posts: n/a
 
      06-02-2010
On Jun 1, 11:53*pm, Sean <(E-Mail Removed)> wrote:
> On Jun 1, 6:57*pm, (E-Mail Removed) (Doug Miller) wrote:
>
> > In article <(E-Mail Removed)>, Sean <(E-Mail Removed)> 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.
 
Reply With Quote
 
Andy Dingley
Guest
Posts: n/a
 
      06-02-2010
On 1 June, 23:48, Sean <(E-Mail Removed)> 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.
 
Reply With Quote
 
Helpful person
Guest
Posts: n/a
 
      06-02-2010


>
> 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
 
Reply With Quote
 
.._..
Guest
Posts: n/a
 
      06-02-2010
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
On 1 June, 23:48, Sean <(E-Mail Removed)> 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.


 
Reply With Quote
 
Beauregard T. Shagnasty
Guest
Posts: n/a
 
      06-02-2010
..._.. 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
 
Reply With Quote
 
 
 
Reply

Thread Tools

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 On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
error: Only Content controls are allowed directly in a content page that contains Content controls. hazz ASP .Net 6 06-09-2010 01:54 PM
Visual Studio Ignores IIS Content Expiration theintrepidfox@hotmail.com ASP .Net 0 03-07-2005 04:53 AM
Re: content expiration? Daenil of GL ASP .Net 1 02-25-2004 10:21 AM
IIS Enable content expiration and .Net objects Mario Hébert ASP .Net 1 01-27-2004 01:45 PM
content expiration Rudy Mark ASP .Net 1 10-16-2003 04:02 PM



Advertisments