Page 1 of 1

PHP "last updated"

Posted: Thu Aug 10, 2006 11:44 am
by Blazeix
Hi. I'm trying to get a 'last updated' PHP script on my website. I have the following embedded at the bottom of my main page, index.html.

Code: Select all

<?php
echo "Last modified: ".date("F d Y H:i:s.",filemtime("index.html"));
?>
When I view the page, there is nothing, no error message or anything. PHP is enabled on the server; other php scripts work fine.

Here is a link to the page where the php script is located. It should appear at the bottom of the page, on the orange bar. I was wondering if it was a permissions problem. Can anyone help? Thanks.

Posted: Thu Aug 10, 2006 11:50 am
by volka
The server is not cofigured to let php handle this request.
When I open the sourcecode view of my browser, there is

Code: Select all

<div id="bttmbar">
<span id="updated">
<?php
echo "Last modified: ".date("F d Y H:i:s.",filemtime("index.html"));
?> 
</span>
</div><!-- end of bttmbar -->

Posted: Thu Aug 10, 2006 12:01 pm
by Blazeix
How can I configure it? when I have to code alone in a php file in the same directory, it works, (here) but when I put it in index.html, it doesn't.

Posted: Thu Aug 10, 2006 12:10 pm
by volka
The server responses with
Server: Apache/2.0.40 (Red Hat Linux)
Therefore: http://de2.php.net/manual/en/install.unix.apache2.php
15. Tell Apache to parse certain extensions as PHP. For example,
let's have Apache parse the .php extension as PHP. You could
have any extension(s) parse as PHP by simply adding more, with
each separated by a space. We'll add .phtml to demonstrate.

AddType application/x-httpd-php .php .phtml

Posted: Thu Aug 10, 2006 12:22 pm
by Blazeix
Thanks. I don't have access to changing settings on the server, but I renamed my index.html to index.php, and now its working. Thank!