That's a cool project! Apart from the obvious technical lackings already mentionned, here is a list of ideas / improvements that you may find useful:
- Before adding anything big (database, file storage, …), starts by a well-structured base: Organization is key, starts by a correct naming convention for other developers to understand your project.
>You can name your modules by their plain name like "header.php", "footer.php", etc… without overheads. Separating the page by modules is a good idea.
>"database.txt" is not exactly a database, more like a message log. Rename it "message_log.txt"
>Name the CSS file "style.css", a well-known name.- Use correct HTML5 tags, it helps everyone (both humans and machines) understanding yout website structure:
https://www.tutorialrepublic.com/html-reference/html5-tags.php.
>Make use of the tags <header>, <body>, <head>, <main>, etc… for a better structure.
>Don't use <center> or <br>, style it with CSS.
>Indent your code.- It would be better to directly include the CSS file in index.php rather than checking if the file exists (why checking?) with a condition. Less useless instructions.
- Do a makefile for straightforward installation.
- Data sanitization is crucial for security (well, except for SQL injection in your case). Here is a small resource to help you:
https://zeroexp.dev/validating-and-sanitizing-user-input-in-php-the-ultimate-guide/. There are others online, do some researches.
There are some breadcrumbs, others may aggrement to those ideas. Keep in mind that starting by a simple, stable base will prevent further hassle - so don't ignore it.