Jump to content

Generate new pages that are automatically linked?


morocco-iceberg

Recommended Posts

I'm attempting to code a blog system, and have currently go the ability to write a blog that is displayed on a seperate page, that can then be commented upon by visitors. What I would like to achieve now is a system that archives the blogs into seperate pages, whilst creating a link on the main page to each of these pages automatically.

 

Any ideas of how to go about this?

By separate pages I assume you don't literally mean a separate file? You'll want to store the article within a database, most likely MySQL. Then you can pass the ID (or some piece of data that can identify the article) through the URL to a file, e.g. view_article.php?id=###. Within the file you'll look up the article in the database and display the contents.

 

On the front page you can simply query the database to return all the articles (or say the most recent 10) and generate the link based on the ID (or the data you use to identify the article).

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.