Hello and thank you for taking the time to read my question.

I am currently moving a static html site into a faux CMS and have a question about which direction is best recommended.

I have series of 'News Articles' that I would like to make available through a db. Each article is approximately 1000 words. Setting up this db is not such a problem, except since I already have all these articles in formatted html, I was thinking I could just list the article titles and URLS to the articles in the DB and do something like:

$content = file_get_contents($url);

?

All this does though is open the full html page.

What I am wondering is how can I open an html page into a new template.

My other question is can I target different parts of an html page (divs?) to display in this template?

$content=file_get_contents($url.div='article_1');

Or am I just better off dumping all the articles into my database?

Anybody have any suggestions/recommendations I would greatly appreciate it!

thanks!

Recommended Answers

All 2 Replies

It would be better to place all the data into a database and perhaps you could make a script that will insert it into the database for you. Then to display the content you just select from the database and display the contents from the database.

Thank you Cwarn. I think you are probably right.

However I did find out how to open an html page and display a specific div.

You can read about it here.

Be a part of the DaniWeb community

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