Webmaster Hints, Tips and Advice

Create A Greeting Message For Your Website

Add that personal touch to your website’s homepage and create a greeting message that changes dependant on the time of day. This simple PHP script will output one of the following messages:

The Script In Action:

Tuesday 8th July 2008

Good morning and welcome to GetOnTheInternet.net.

To include this script in your webpage, simply copy and paste the following code or click here to download file:

<?php
//Greet Your Website Visitors With This Free PHP Script
//A PHP Script From GetOnTheInternet.net
$now = gmdate ('H');
echo date ('l jS F Y');
if ($now < 12)
echo ('<p>Good morning and welcome to <a href="http://www.getontheinternet.net" target="_blank">GetOnTheInternet.net</a>.');
else if ($now < 18)
echo ('<p>Good afternoon and welcome to <a href="http://www.getontheinternet.net" target="_blank">GetOnTheInternet.net</a>.');
else if ($now >= 18 )
echo ('<p>Good evening and welcome to <a href="http://www.getontheinternet.net" target="_blank">GetOnTheInternet.net</a>.');
//For More Free Webmaster Resources Visit http://www.getontheinternet.net
?>

This article can be found at: www.getontheinternet.net/webmaster-tips/php-greeting/index.shtml

[Updated - 01 April 2007]

Copyright © 2007 David Kaye – All rights reserved.
For more free webmaster tips and articles like this on website design, hosting and promotion visit http://www.GetOnTheInternet.net

Link to this article

If you would link to link to this article please copy and paste the following code into your webpage:

<a href="http://www.getontheinternet.net/webmaster-tips/php-greeting" target="_blank">Free PHP Script to Create A Greeting Message For Your Website</a>

Click here to read more free website design and hosting hints, tips and advice