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?

Link to comment
Share on other sites

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).

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.