Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 13 of 13

Thread: Day

  1. #1
    Senior Coder gsnedders's Avatar
    Join Date
    Jan 2004
    Posts
    2,340
    Thanks
    1
    Thanked 7 Times in 7 Posts

    Day

    Can anyone write me a php script which says "Today is " followed by the day?

  • #2
    New to the CF scene
    Join Date
    Jan 2004
    Location
    Florence, AL
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    http://www.php.net/manual/en/function.date.php

    This will have what you need. This is one of my most frequently looked up pages on the manual, I can't seem to remember alot of the date function's arguments, even though I use them nearly daily

  • #3
    Senior Coder gsnedders's Avatar
    Join Date
    Jan 2004
    Posts
    2,340
    Thanks
    1
    Thanked 7 Times in 7 Posts
    I don't know any php but for what this is being used for it needs to be in php so can some write me a script.

  • #4
    New to the CF scene
    Join Date
    Jan 2004
    Location
    Florence, AL
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Example 1 and 2 have full working lines of code. Just pick which way you want it to look.

  • #5
    Senior Coder Nightfire's Avatar
    Join Date
    Jun 2002
    Posts
    4,265
    Thanks
    6
    Thanked 48 Times in 48 Posts
    Today is <?php echo date("l"); ?>

  • #6
    Senior Coder gsnedders's Avatar
    Join Date
    Jan 2004
    Posts
    2,340
    Thanks
    1
    Thanked 7 Times in 7 Posts
    Originally posted by Nightfire
    PHP Code:
    Today is <?php echo date("l"); ?>
    So I just put that in the .php page I take it.

  • #7
    Senior Coder Nightfire's Avatar
    Join Date
    Jun 2002
    Posts
    4,265
    Thanks
    6
    Thanked 48 Times in 48 Posts
    Yeah, just put it wherever you want it to show

  • #8
    Senior Coder gsnedders's Avatar
    Join Date
    Jan 2004
    Posts
    2,340
    Thanks
    1
    Thanked 7 Times in 7 Posts
    Thanks

  • #9
    Senior Coder gsnedders's Avatar
    Join Date
    Jan 2004
    Posts
    2,340
    Thanks
    1
    Thanked 7 Times in 7 Posts
    I have got this
    Code:
    <P><CENTER><FONT SIZE="+1" FACE="Arial">Today is <?php echo date("l"); ?> </FONT></CENTER></P>
    but it is not working

  • #10
    New to the CF scene
    Join Date
    Jan 2004
    Location
    Florence, AL
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Did you name the file index.php or pagename.php (whatever your page is named) instead of pagename.html?

  • #11
    Senior Coder Nightfire's Avatar
    Join Date
    Jun 2002
    Posts
    4,265
    Thanks
    6
    Thanked 48 Times in 48 Posts
    And is php enabled on your server?

  • #12
    me'
    me' is offline
    Senior Coder
    Join Date
    Nov 2002
    Location
    Warwickshire, England
    Posts
    1,229
    Thanks
    0
    Thanked 0 Times in 0 Posts
    And is it on a server, not being viewed locally?
    David House - Perfect is achieved, not when there is nothing left to add, but when there is nothing left to take away. (Antoine de St. Exupery).
    W3Schools | XHTML Validator | CSS Validator | Colours | Typography | HTML&CSS FAQ | Go get Mozilla Now | I blog!

  • #13
    Senior Coder gsnedders's Avatar
    Join Date
    Jan 2004
    Posts
    2,340
    Thanks
    1
    Thanked 7 Times in 7 Posts
    Originally posted by gammahelixx
    Did you name the file index.php or pagename.php (whatever your page is named) instead of pagename.html?
    That's the problem, thanks!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •