PHP help

khan

Well-Known Member
OP
Member
Joined
Mar 17, 2003
Messages
1,320
Trophies
0
Age
53
Website
Visit site
XP
355
Country
Pakistan
Hi all,

In my free time, I am trying to make a professional looking website on which I would like to display date with message i.e. good morning/afternoon/evening or night.

I have found a very basic php script however I would really appreciate if someone could expand it so it prints out message along side the side as mentioned above. (BTW I have tried google to no avail)

[/color]

Thanks
 

Kyuzumaki

Well-Known Member
Member
Joined
Dec 24, 2006
Messages
251
Trophies
0
XP
247
Country
United States
i don't have time to check the syntax costello will probably know but you just need a few if's. time() is a number indicating how many seconds have passed since midnight

so something like
//before 12noon
if(time()43200 & time()64800 & time()75600){echo("Good night")}
 

WishCow

Well-Known Member
Newcomer
Joined
Jul 24, 2006
Messages
85
Trophies
0
XP
115
Country
Hungary
date('H'); returns the hour of the day, so you can do ifs:

if (date('H') > 12) {
echo("It's past twelve");
}
 

FrozenOne23

Well-Known Member
Member
Joined
Sep 23, 2006
Messages
174
Trophies
0
Age
32
Website
Visit site
XP
204
Country
Netherlands
i don't have time to check the syntax costello will probably know but you just need a few if's. time() is a number indicating how many seconds have passed since midnight

so something like
//before 12noon
if(time()43200 & time()64800 & time()75600){echo("Good night")}

Uhm, time() is a function to display the seconds since January 1 1970 00:00:00 GMT
 

Sinkhead

yay p1ngpong.
Former Staff
Joined
Nov 22, 2006
Messages
3,689
Trophies
0
Age
31
Location
Across the pond
Website
Visit site
XP
257
Country
To print a message in PHP use
CODE
So in your example you would use
CODE

I made a sample script here. Oh, and by the way, PHP uses the server's time so things get a little funky when timezones are brought in. You need to collect the time offset from server time from the user then store it somewhere and when the time is needed the difference should be calculated from server time. But that's only if you want to be clever.
- Sam
 

khan

Well-Known Member
OP
Member
Joined
Mar 17, 2003
Messages
1,320
Trophies
0
Age
53
Website
Visit site
XP
355
Country
Pakistan
Thank you all for your suggestions/help.

I am now working on a search engine which works as I wanted to however when there are more than 1 matching results then it still produces 1 single table display just 1 output result.

QUOTE said:
[/color]
[/color]




 
   
   
      [/color]
     
   
   
      [/color]
       
      [/color]
       
   
   
      £[/color]
       
   
 

I was wondering if some kind soul could help me out here, I just want php page to display a separate table with product details for every result it finds( i.e. if 2 products match search string then I would like 2 tables).

Thanks in advance
 

Kasoz

Well-Known Member
Newcomer
Joined
May 16, 2007
Messages
97
Trophies
0
XP
43
Country
Netherlands
You definetly need to learn some more PHP, this is really basic, and you can learn all these kind of things from a good book anyway, you only fetch 1 row, instead of multiple rows

QUOTE said:
Dump the

is the same

QUOTE




Â
 Â
 Â
  Â
   
 Â
 Â
  Â
    
  Â
    
 Â
 Â
   £
    
 Â
Â
 

khan

Well-Known Member
OP
Member
Joined
Mar 17, 2003
Messages
1,320
Trophies
0
Age
53
Website
Visit site
XP
355
Country
Pakistan
You definetly need to learn some more PHP, this is really basic, and you can learn all these kind of things from a good book anyway, you only fetch 1 row, instead of multiple rows

QUOTE said:
Dump the

is the same

QUOTE said:
 
   
   
     
     
   
   
     
       
     
       
   
   
      £
       
   
 

Thanks alot Kasoz for your help. It works
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    Xdqwerty @ Xdqwerty: good night