Jump to content

[HTML] Most efficient way for updating article category?

Anthony10
Go to solution Solved by DavidTheWin,

Are you looking at the page source in your browser? If so, that's just what the browser renders. Behind the scenes there is a different language, likely PHP, that handles getting the recent articles etc. When the page is displayed, the PHP code is ran and the HTML result of that PHP code is added into the HTML code that the PHP code is embedded in and the entire result is displayed to your browser.

 

E.g.

Source code:

 

<html stuff including header and menu bar>

<php list that will get the most recent articles from the database and give them a nice format

<other html stuff such as page footer>

 

When the browser renders it:

<html stuff including header and menu bar>

<html list of formatted recent articles>

<other html stuff such as page footer>

So I have been trying to learn code to make a tech website. I am looking a lot at anandtech as a guide on how I should be coding.

 

I noticed in their code that they have each article written into the code rather than like code that tells it to find it from somewhere where they can update it.

Does that make sense? xD

 

So, for a "Recent articles" section like anandtech has, would updating the code with each specific article be the most efficient way? Or is there some program that lets you tell your code to snatch the articles titles and pictures from somewhere?

 

Thanks!

 

Link to comment
Share on other sites

Link to post
Share on other sites

Are you looking at the page source in your browser? If so, that's just what the browser renders. Behind the scenes there is a different language, likely PHP, that handles getting the recent articles etc. When the page is displayed, the PHP code is ran and the HTML result of that PHP code is added into the HTML code that the PHP code is embedded in and the entire result is displayed to your browser.

 

E.g.

Source code:

 

<html stuff including header and menu bar>

<php list that will get the most recent articles from the database and give them a nice format

<other html stuff such as page footer>

 

When the browser renders it:

<html stuff including header and menu bar>

<html list of formatted recent articles>

<other html stuff such as page footer>

Link to comment
Share on other sites

Link to post
Share on other sites

And behind that PHP code is likely a MySQL database that actually stores the content.

 

The PHP code queries the database, shoves it into an HTML template, and sends it on to your browser.

Link to comment
Share on other sites

Link to post
Share on other sites

Are you looking at the page source in your browser? If so, that's just what the browser renders. Behind the scenes there is a different language, likely PHP, that handles getting the recent articles etc. When the page is displayed, the PHP code is ran and the HTML result of that PHP code is added into the HTML code that the PHP code is embedded in and the entire result is displayed to your browser.

 

E.g.

Source code:

 

<html stuff including header and menu bar>

<php list that will get the most recent articles from the database and give them a nice format

<other html stuff such as page footer>

 

When the browser renders it:

<html stuff including header and menu bar>

<html list of formatted recent articles>

<other html stuff such as page footer>

 

And behind that PHP code is likely a MySQL database that actually stores the content.

 

The PHP code queries the database, shoves it into an HTML template, and sends it on to your browser.

Ah okay thanks!

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×