0

I know little PHP, but even less MySQL, and my host doesn't allow remote database connections (for example, from Dreamweaver), so in addition to being confusing to me, database management is impractical. Is there any way to put a timestamp on an article automatically, without resorting to MySQL tables?

3
Contributors
2
Replies
4
Views
5 Years
Discussion Span
Last Post by Sogo7
0

If you're using flat files to store information, linux stores the creation date of the file and you can use that, but I assume that if you don't have access to a database you're not going to have access to the shell either.

Best suggestion would be for the first line of the article to be its date ;) Even better suggestion would be to find a new host.

0

There is a PHP class that gives you a virtual SQL database using flat files. see-> http://www.fsql.org/

Alternatively you could code something up yourself using fileatime & filetime.
<?php
// get file access/modification times
echo "Last accessed on: " . date("d-m-y", fileatime('myfile.html'));

echo "Last modified on: " . date("d-m-y", filemtime('myfile.html'));
?>

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.