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?

Recommended Answers

All 2 Replies

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.

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.
// 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'));

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.