x1222 Posted October 3, 2009 Share Posted October 3, 2009 Hello, When people submit information into a form, how do sites generate new pages that contains it? I guess an example would be how a forum post has it's own unique page and page ID. Is a new page actually created each time or is it a single template page accessing mysql and displaying the data? Thanks. Link to comment https://forums.phpfreaks.com/topic/176375-how-do-forums-posts-and-page-generation-work/ Share on other sites More sharing options...
cags Posted October 3, 2009 Share Posted October 3, 2009 I've seen both systems used, but by far the most common and I must say more logical approach is the later. When somebody submits information into a form you store it in a database. Then you simply need a way to identify individual items. Since you brought it up as an example, take this forum. If you look at the Address bar in your browser as you navigate around the site, you will notice that you are always on the page index.php. The site then uses $_GET attributes to identify which specific topic/thread etc to display. If you check out any of your favourite sites you will probably notice they do the same sort of thing. YouTube, Facebook etc. Once you get this down, some sites use a slightly more complex 'Pretty URL'. Such as Twitter and YouTube channels. This normally revolves around using .htaccess files to redirect URL's to a single page that can then analyse the url as a string and load the correct information. Link to comment https://forums.phpfreaks.com/topic/176375-how-do-forums-posts-and-page-generation-work/#findComment-929599 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.