Page 1 of 1

File Modified Date/Time

Posted: Wed Jul 30, 2003 11:32 pm
by fractalvibes
Quick Simple Question:
If I want a little blurb at the bottom of all my pages on a site
Last Modified 07/30/2003
I'd like simply to include a common script to do this for each page.
Looks like the function filemtime($myfile) is what I need. So - two questions:

Is there a simple special value I can pass so the $myfile is always the
page in question? i.e. a special "me" value?

If so, will this get the change date of the page in question, or simply the included file?

many thanks and sorry for such a dumb question!

Phil J.

Posted: Wed Jul 30, 2003 11:38 pm
by jmarcv
#1, consider:
include 'footer.inc';

Where footer is the code to display the modified time.

Second, if it is apache, consider the special $PHP_SELF global variable.

Posted: Wed Jul 30, 2003 11:46 pm
by fractalvibes
Thanks - that is what I was looking for.

Will $PHP_SELF resolve to the included file or the file that includes it?

thanks!

Phil J.

Posted: Wed Jul 30, 2003 11:51 pm
by jmarcv
Try it. You will see that it defaults to the 'parent' script, not the include.

Posted: Thu Jul 31, 2003 12:19 am
by fractalvibes
Ok will do - thanks!

Phil J.