5 replies [Last post]
seb
Offline
Enthusiast
Last seen: 12 years 38 weeks ago
Joined: 2003-09-20
Posts: 208
Points: 0

Does it build html pages whenever someone makes a post, or is it a clever filter of some sort that takes the "file name" and parses it?

Tony
Tony's picture
Offline
Moderator
Brisbane
Last seen: 1 day 5 hours ago
Brisbane
Timezone: GMT+10
Joined: 2003-03-12
Posts: 5342
Points: 2963

How does the forum work?

Hi seb,
The forum works on a templating system with MySQL holding all the data.

Posts are stored in the MySQL database.
Then when a page is called by a browser, PHP extracts the required data from the database then renders it via the template.

There's actually a little more to it and I can now see where you came up with the html files idea.
PHP uses GET( variables passed with the url) and POST (variables sent with forms) variables to know which page or content to display.
To complicate things a little Apache ( web server) modifies the GET variables in many cases and changes them from something like http://www.csscreator.com/css-forum to http://www.csscreator.com/css-forum/forum16.html
Anything after the ? is GET variables sent to index.php

Search engines such as Google are not really keen on dynamic pages so we use Apache to rewrite the urls then do the magic required to give PHP the correct get variables when a link is clicked.

Hope that helps

roytheboy
roytheboy's picture
Offline
Guru
North Wales, UK
Last seen: 6 years 12 weeks ago
North Wales, UK
Timezone: GMT+1
Joined: 2004-09-18
Posts: 2233
Points: 41

How does the forum work?

[posted at exactly the same time as Tony's above]

http://www.phpbb.com/

It's all about database control and manipulation. The core principles are the same for any web application: build a carefully structured depository of information; amend and update it in response to particular trigger events; and extract only the relevant information that you need at any one time.

Using php to enter and access the information, and to create HTML pages on the fly, means that anyone skilled in php can understand and amend the way that the application works (provided universal coding standards have been followed by the author).

Using mysql to store the information means that the depository can hold a staggering amount of data which can be sorted and access in unbelievably quick time (provided the tables have been built skillfully and with just the right type of indexes).

That's how this forum works: just like any other decent web application (although obviously there are other scripting languages and database types - it's just that php and mysql are probably the most accessible and therefore popular).

Keep learning that php Seb Wink

Life's a b*tch and then you die!

seb
Offline
Enthusiast
Last seen: 12 years 38 weeks ago
Joined: 2003-09-20
Posts: 208
Points: 0

How does the forum work?

sorry, i should have been clearer in my question - as a web devleoper I know perfectly well how dynamic database driven server-side scripted sites work, I feel quite patronised now Smile

I was referring to the "fthread1600.html" etc - merely curious as to whether these are truly static pages that the application generates to minimise hits to the database, or whether they're not really html files, they do in fact go through the php parser and the number "1600" pulled out as a database ID where the app then gets the thread from.

Which I think tony answered Smile

roytheboy
roytheboy's picture
Offline
Guru
North Wales, UK
Last seen: 6 years 12 weeks ago
North Wales, UK
Timezone: GMT+1
Joined: 2004-09-18
Posts: 2233
Points: 41

How does the forum work?

seb wrote:
...I feel quite patronised now Smile.

Oops :oops: ...sorry Seb - I just assumed that you were a designer yet to learn about developing Laughing out loud Look, look: I'm hitting myself Laughing out loud

Life's a b*tch and then you die!

seb
Offline
Enthusiast
Last seen: 12 years 38 weeks ago
Joined: 2003-09-20
Posts: 208
Points: 0

How does the forum work?

Nope, very much a developer who wishes he had more flair for design - been devloping ASP/MS SQL sites for a couple of years now, before that I'd used PHP & MySQL briefly, and now I'm relearning PHP again.