Last-modified?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Rarpy

    Last-modified?

    Hi all,

    I tried putting this at the beginning of a PHP file:

    <?php
    echo "Last-modified: " . date( "F d Y.", getlastmod() );
    print "";
    ?>

    The goal was to ensure that the browser would realize
    that the page is newly produced HTML. However its not
    working. The browser shows above the page the expression
    Last-modified: ...

    Can anyone explain how to properly do this?

    Thanks.

  • Benjamin

    #2
    Re: Last-modified?



    On Jan 29, 9:09 pm, "Rarpy" <Rexun...@yahoo .comwrote:
    Hi all,
    >
    I tried putting this at the beginning of a PHP file:
    >
    <?php
    echo "Last-modified: " . date( "F d Y.", getlastmod() );
    print "";
    ?>
    have you checked to see if getlastmod is actually returning a value?
    >
    The goal was to ensure that the browser would realize
    that the page is newly produced HTML. However its not
    working. The browser shows above the page the expression
    Last-modified: ...
    >
    Can anyone explain how to properly do this?
    >
    Thanks.

    Comment

    • Curtis

      #3
      Re: Last-modified?

      Rarpy wrote:
      Hi all,
      >
      I tried putting this at the beginning of a PHP file:
      >
      <?php
      echo "Last-modified: " . date( "F d Y.", getlastmod() );
      print "";
      ?>
      >
      The goal was to ensure that the browser would realize
      that the page is newly produced HTML. However its not
      working. The browser shows above the page the expression
      Last-modified: ...
      >
      Can anyone explain how to properly do this?
      >
      Thanks.
      >
      If you're actually trying to send a header, you need to use the
      header() function, not echo it out. Make sure you send the headers
      before any output is sent.

      See: http://php.net/header

      --
      Curtis

      Comment

      • Diilb

        #4
        Re: Last-modified?

        There is a good example of sending the last modified header on the
        getlastmod doc page. Consider checking it out:



        On Jan 29, 11:09 pm, "Rarpy" <Rexun...@yahoo .comwrote:
        Hi all,
        >
        I tried putting this at the beginning of a PHP file:
        >
        <?php
        echo "Last-modified: " . date( "F d Y.", getlastmod() );
        print "";
        ?>
        >
        The goal was to ensure that the browser would realize
        that the page is newly produced HTML. However its not
        working. The browser shows above the page the expression
        Last-modified: ...
        >
        Can anyone explain how to properly do this?
        >
        Thanks.

        Comment

        Working...