0
Thanks

A few words of thanks would be greatly appreciated.

PHP - Change the greetings message on you website





Introduction

Change the welcome message on your website according the the time of the day.
Well it would be quite Inappropriate to dispaly a "Hello Good Morning" in an article of your website at nigh-time.

Solution

  • It is possible to remedy this through the language that is PHP.
  • Here's a little script that will display "Good morning" or "Good evening" according to the time of the day.
  • Insert this code your HTML source:



  • This script works for a schedule. It does not fit in time zone differences. So it does not fit to the time zone of visitor.


Thanks to le petit marocain for this tip.
0
Thanks

A few words of thanks would be greatly appreciated.

Ask a question
CCM is a leading international tech website. Our content is written in collaboration with IT experts, under the direction of Jean-François Pillou, founder of CCM.net. CCM reaches more than 50 million unique visitors per month and is available in 11 languages.
This document, titled « PHP - Change the greetings message on you website », is available under the Creative Commons license. Any copy, reuse, or modification of the content should be sufficiently credited to CCM (ccm.net).

0 Comments