开发者

How do websites change content daily?

I just started learning HTML and CSS, with no knowledge开发者_Go百科 on other languages such as javascript, Php, and so forth. Websites like Refdesk.com boast fresh content everyday, there has to be someway they are able to have new content everyday other then changing it by hand. Some Google searches came up with nothing but RSS feeds.

How is this done?

Thanks for the helpful answers, it answers half of my question, but does this also mean that the owner would have to manually add the webpage each day for new content, or say add in the content for a few days and have them displayed day after day automatically?


Most dynamic websites derive their page content from a database. Change the content in the database, and the content on the pages changes to follow suit.


Likely they have some form of content management system which allows non-technical users to update the site. In some systems, the content manager itself can get quite advanced. Here's a description of the latest version of the one used at the BBC, CPS, which drives the many BBC websites and more.

How do websites change content daily?


They most probably use a database where they store the content and the newest entries are retrieved from this database and displayed. This requires a server side language like PHP, Java, Python.
The HTML is generated dynamically.


The answers about databases combined with a server-side language like PHP are pretty good and very direct, but depending on how new you are to web development they might not be conceptual enough.

The first thing you need to understand is that a database is a collection of tables - each like any you might be familiar with in excel.

For example, one table in your database might be named "daily_links" and it might have two columns, one named "Date", and one named "Link". So every time you want to publish a new link, you just make a new row.

So now you are half way there.

Now what the server-side scripting language is able to do is to go to the database, look at your table "daily_links" and bring back each all the information that it found there.

From there it can do anything with that information like make a new anchor tag in html for each row it found, and give it an href of the data found in the column "Link".

That is rough idea in (very) general terms.

I hope that is easy to understand.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜