Last Updated On Script - help needed.

Discussion in 'PHP' started by Mage, Nov 5, 2007.

  1. #1
    Hi, I'm trying to implement the Last Updated On script on my index.html page. Here are the instructions from Uber Affiliate:

    I replaced [] with <>, yet nothing comes up when I test the page.
     
    Mage, Nov 5, 2007 IP
  2. QuattroPorte

    QuattroPorte Peon

    Messages:
    12
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    
    <?php
    	$yesterday = date('m/d/Y', mktime(0, 0, 0, date("m") , date("d") - 1, date("Y")));
    ?>
    Last Updated On : <?php echo $yesterday ?>
    
    PHP:
    This absolutely does work!

    You should get "Last Updated On : 11/04/2007" (for today).

    Check your syntax.
    Make sure you don't have any weird control characters.
    Make sure you upload in ascii.
     
    QuattroPorte, Nov 5, 2007 IP
  3. bobb1589

    bobb1589 Peon

    Messages:
    289
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #3
    you need to save the file as index.php not .html ;-) or add the .html to the htaccess to run php
     
    bobb1589, Nov 5, 2007 IP
  4. QuattroPorte

    QuattroPorte Peon

    Messages:
    12
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    One more thing....
    If you don't want to back-date the thing to "yesterday" you can simply do:

    Last Updated On : <?php echo date('m/d/Y') ?>
    
    PHP:
     
    QuattroPorte, Nov 5, 2007 IP
  5. QuattroPorte

    QuattroPorte Peon

    Messages:
    12
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Yup, that will do it too :)
     
    QuattroPorte, Nov 5, 2007 IP
  6. Mage

    Mage Well-Known Member

    Messages:
    301
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    128
    #6
    OK I changed the index.html to index.php. Thanks, works fine.
     
    Mage, Nov 5, 2007 IP