Html网站的动态文本为客户定制? PHP / HTML? [关闭]

I am in following situation:

I am Programming a Website for a small local mobile repair shop. So far so good. Problem is, the Client wants to change the text every week because of new Offers. He does not know any coding, but he can use the computer as far as Word or a text document.

My Question: Is it possible to use external Sources of text for this? For example a offer.txt which I include in the page via php?

The question is, If the Text format will be the same for example fonts or stiley applied to it, or will I encounter any problems doing so?

You can use a database(may be Mysql) to store the text, and retrieve it using sql query.I think which will the most reliable solution.

But as you said, you can also show some text from a .txt file with the aid of PHP. The procedure is described below:-

1. place your text file with .txt extension in the same directory where php file is located (if not, you must specify the exact path to the file in php code)

2. In your php file add the below code :

<?php
$myfile = fopen("yourfile.txt", "r") or die("Unable to open file!");
echo fread($myfile,filesize("yourfile.txt"));
fclose($myfile);
?>

you can format the text like this

echo "<b>". fread($myfile,filesize("yourfile.txt"))."</b>";

this line must be written after opening the file and before closing the file as done in the above example

Don't forget to change "yourfile.txt" with your text file name

Hope This Helps...