Help Me To show Time Greetings 2 visitors in PHP

Started on the old forum in July 2009 · view the original in the archive · old links redirect here

3 replies · 587 views · started 17 years ago · 1 min read

3 participants
prajwal Junior · 19 posts #1

Help Me To show Time Greetings 2 visitors in PHP I hav made a small scpipt but doesnt wrk Pls Any1 Help Me 🙁 😳😐😕

Here is it

<? echo"Good "; if(time >=6) print"Morning"; else if(time >=12) print"Afternoon"; else if(time >=16) print"Evening"; else if(time >=21) print"night"; echo"!"; ?>
opticalpigion Lead · 593 posts #2

prajwal wrote: Help Me To show Time Greetings 2 visitors in PHP I hav made a small scpipt but doesnt wrk Pls Any1 Help Me 🙁 😳😐😕

Here is it

<? echo"Good "; if(time >=6) print"Morning"; else if(time >=12) print"Afternoon"; else if(time >=16) print"Evening"; else if(time >=21) print"night"; echo"!"; ?>
<?
putenv("TZ=Asia/calcutta");

$New_Time = time() + ($TZ * 60 * 60); 

$show_date=date("D dS F, Y",$New_Time);  
$show_time=date("H:i",$New_Time);  
$time=date("G",$New_Time); 

echo"Good ";
if($time >=6) print"Morning";
else if($time >=12) print"Afternoon";
else if($time >=16) print"Evening";
else if($time >=21) print"night";
echo"!";
?>
prajwal Junior · 19 posts #3

Thanx Very Much Opticalpigion ,, U R a Prety good coder,,

anderson Developer · 146 posts #4

anybody give me idea to make time greeting message for minute count instead of hour. e.g- per message will be changing after 30 mins.

Wait...

Write your reply now; next you create a free account (or sign in) and it is posted right away. Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close