logo Lee Johnson SEO

PHP Time for a Welcome to Your Visitors

Make your homepage a welcoming by adding a time related intro.

You can see an example at leejohnson.it

Check out the purple section to show what time of day the server is showing to the visitor. It makes the page content change several times a day and it weels welcoming.

// Between 12am-3am
$welcome_string="Hi night owl";
// Between 4am-11am
else if($numeric_date>=4&&$numeric_date<=11)
$welcome_string="Good morning";
// Between 12pm-4pm
else if($numeric_date>=12&&$numeric_date<=16)
$welcome_string="Good afternoon";
// Between 5pm-11pm
else if($numeric_date>=17&&$numeric_date<=23)
$welcome_string="Good evening";
echo "$welcome_string";