Home | Scripts | Tutorials | Books | Hosting | Forums | Links|

Navigation:

Home
Source code
Tutorials
RSS feeds
Articles
Books
Software
Downloads
Hosting
manuals
Forums
Script directory
Training
Our Links

ADD TO Progged Progged
ADD TO DEL.ICIO.US Del.icio.
ADD TO DIGG Digg
ADD TO FURL Furl
ADD TO NEWSVINE Newsvine
ADD TO NETSCAPE Netscape
ADD TO REDDIT Reddit
ADD TO STUMBLEUPON StumbleUpon
ADD TO TECHNORATI FAVORITES Technorati
ADD TO SQUIDOO Squidoo
ADD TO WINDOWS LIVE Windows Live
ADD TO YAHOO MYWEB Yahoo MyWeb
ADD TO ASK Ask
ADD TO GOOGLE Google
ADD TO MAGNOLIA Magnolia
ADD TO SPURL Spurl



 
 

SPONSORS



 
 

Time based greeting

This shows how to display a time based greeting to your visitors . I will make one comment before I go on , if you are coming from other programming languages such as VBScript etc then be very careful with your If , else if , else structures . What do I mean well the best scenario is that End If is not required at the end of your if statements . (caught me out a few times).

Anway here is the code for this example

<?php
$theDate = date("H");
if($theDate < 12)
echo "Good morning to you";
else if($theDate < 18)
echo "Good afternoon to you";
else
echo "Good evening to you";

?>

And here is the result

Good afternoon to you