AllExperts > Experts 
Search      

Web Design

Volunteer
Answers to thousands of questions
 Home · More Questions · Answer Library  · Encyclopedia ·
More Web Design Answers
Question Library

Ask a question about Web Design
Volunteer
Experts of the Month
Expert Login

Awards

About Us
Tell friends
Link to Us
Disclaimer

 
 
 
 
About Marty Landman
Expertise
Perl programming using CGI, databases, HTML templating, and website automation.

Experience
Web developer since 1998, owner of Face 2 Interface.

 
   

You are here:  Experts > Computing/Technology > Web Design > Web Design > Display a weekly message

Topic: Web Design



Expert: Marty Landman
Date: 7/1/2008
Subject: Display a weekly message

Question
QUESTION: Hi Marty

I'm an amateur trying to maintain a community website for our small English village. I want to make the site useful, and one thing would be to say which type of waste is collected each week. One week the general "landfill waste", and the next "Recyclable". What I want, therefore, is to know how to automatically display a message that alternates each week. I can find ways to display a message according to time of day, but not one to display a message according to which week of the year! Any suggestions - or pointers to resources - gratefully received. For your info the site is www.almondsburycommunityshop.org.uk/

Kind regards - Chris

ANSWER: Hi Chris,

Nice site, and nice town. To do this you'll need a little bit of programming. Can you find out what scripting is allowed by your hosting provider?

Ideally Perl and SSI would be best, but for such a simple application it could be most anything.

--
Marty Landman, Face 2 Interface Inc.
Drupal Development Blog: http://drupal.face2interface.com/
Free Database Search App: http://face2interface.com/Products/FormATable.shtml

---------- FOLLOW-UP ----------

QUESTION: Thanks for the really quick response, Marty.

I've had a look at my Hosting Package with 1and1, and I get SSI and PHP 4 & 5, but not Pearl. I've not done any programming before!

Chris

Answer
Chris, look at the PHP date function - http://us3.php.net/date.

You can retrieve the week of the year as a number. Then to alternate output on a weekly basis between trash and recycling just figure out whether trash is on even weeks and recycling on odd weeks, or vice versa.

Of course you'll need to first start learning a bit about PHP and programming. Check out this beginner's tutorial - http://littlelink.webtrouble.com/?klI8.

Let me know how it goes.  

Add to this Answer    Ask a Question



  Rate this Answer
   Was this answer helpful?
Not at allDefinitely              
   12345  

     
About Us | Advertise on This Site | User Agreement | Privacy Policy | Help
Copyright  © 2008 About, Inc. About and About.com are registered trademarks of About, Inc. The About logo is a trademark of About, Inc. All rights reserved.