Re: [PHP] Time code!!!

2003-01-20 Thread Justin French
Please post in raw text, not HTML.

?php echo date('d m y'); ?

look in the manual to decide what format you need to replace 'd m y' with:

http://php.net/date


The welcome back bit all depends on cookies, sessions, how your login
scripts work, etc etc.


Justin


on 20/01/03 12:46 PM, Karl James ([EMAIL PROTECTED]) wrote:

 does anyone have the code to where i can have the time
 
 printed on my home page like for example
 
 
 
 
 
 Monday, January 19, 2003
 
 
 
 also I want to have it state when the users login in
 
 it says 
 
 welcome back, (name)
 
 
 
 any advise would be fantastic?
 
 
 
 Thanks Karl


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Time code!!!

2003-01-20 Thread Larry E. Ullman
does anyone have the code to where i can have the time
printed on my home page like for example
 Monday, January 19, 2003


The PHP Manual has this code, under the date() function 
(www.php.net/date).

echo date (l, F j, Y);

 also I want to have it state when the users login in
it says
welcome back, (name)


The PHP Manual can help you out on this one, too: www.php.net/echo or 
www.php.net/ print

echo welcome back, $username;


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Time code!!!

2003-01-20 Thread David Freeman
Hi Karl

First up, would you mind posting your messages in plain text instead of
html format?  It's just a courtesy to the rest of us.

  does anyone have the code to where i can have the time
  printed on my home page like for example
 
  Monday, January 19, 2003

Sure, check out the date() function in the php manual - you can output
current date in just about any format you care to choose.

Something to consider though, the date that you get is based on the date
on the server - so if your server is in a different time zone to you
it'll look odd, ditto for someone viewing your page from a different
time zone.  Of course, if you and most people browsing your page are in
the same time zone that won't matter.  Also, you may want to display it
that way anyhow (I do it on some of my web sites to show what time it is
where the business who owns the site is located).

If you actually want to display local time for the person viewing the
web page then you'll need to use javascript and grab local date/time
from the local computer.

  also I want to have it state when the users login in
  it says welcome back, (name)

First thing you need to do is decide how you're going to store that
information.  Are you going to store user information in cookies?  In a
database?  Flat files?  Are you going to have the person log in before
you display the welcome?  Or are you trying to pick it up automatically?
How complex and how reliable do you want to have this capability?

  any advise would be fantastic?

If you check the manual, particularly the fully annotated version at
http://www.php.net/ you'll find a wealth of examples and code snippets
that'll help you out.

CYA, Dave




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php