[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [cobalt-users] Execute php from a .shtml file



:> I need to execute some php commands within a .shtml file.
:> Renaming the file
:> is not an option.  An example of some code would be
:> <? echo date("m/d/Y", getlastmod()); ?> to get the modification
:> date of the
:> file.
:>
I'm not yet a PHP expert but would you be better not to simply write a php
page with your necessary functions, getting it to write the output to screen
and then actually include your php file into the shtml page.

eg;
lastmod.php -> contents
<?PHP
	echo date("m/d/y", getlastmod());
?>

then include into yourpage.shtml ->
<!--#include virtual="lastmod.php"-->

Altho I guess that if you are trying to get your php to return the latest
update to yourpage.shtml this most likely wouldn't work!

If it is the latest updates to yourpage.shtml that you want, there are
specific ssi functions to do this. Refer to the apache site or any good
tutorial/reference pages like this one;
http://www.bignosebird.com/sdocs/echo.shtml

HTH

Kind Regards
Si Watts
http://www.siwis.co.uk