SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Guru D-flyer's Avatar
    Join Date
    Jan 2001
    Location
    Near a computer
    Posts
    782
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi there,

    I don't know what i am doing wrong but when i use:

    <?php print("$date"); ?>

    then the result (in my browser) is:

    32767

    Not something like 20010207

    What am i doing wrong?

    Greetz

  2. #2
    SitePoint Columnist Skunk's Avatar
    Join Date
    Jan 2001
    Location
    Lawrence, Kansas
    Posts
    2,066
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    $date is a variable name.

    Try
    Code:
    print date();

  3. #3
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can use $date as a variable name, where is the $date coming from though?
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  4. #4
    SitePoint Wizard
    Join Date
    Apr 2000
    Posts
    1,483
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you go here:
    http://php.net/date

    You can find details of all the commands you can use with date() to make dates of different formats.

  5. #5
    SitePoint Guru D-flyer's Avatar
    Join Date
    Jan 2001
    Location
    Near a computer
    Posts
    782
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    I am using the $date to navigate thru a weblog, well i am practicing with PHP4 (PHP4 Bible, dutch version Chapter 21). I already found a couple faults. Based on $date there will be a next and previous link. But when i put a text in my weblog the $date becomes a number in mysql_db

    In php4 bible they use:

    if(!IsSet($date))
    {
    $date = date("Ymd");
    }
    ?>


    Can't figure it out

    Greetz
    D-flyer


Bookmarks

Posting Permissions

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