KevinM1 Posted October 27, 2006 Share Posted October 27, 2006 I wasn't exactly sure where to ask this. I was thinking about putting it in the design section of the forum, but this seems too general for that. In any event, here's my question:I've seen a lot of URLs, especially in message boards, that have a structure like: www.somesite.com/forum/viewthread.php?forum_id=1&thread_id=1#post_1234. Even the address of the page I'm at right now ends in ?action=post;board=14.0. Something like that is basically a $_GET[] way of producing the correct page, right? Is there any particular reason as to why this action method is the method of choice for things like message boards? Quote Link to comment https://forums.phpfreaks.com/topic/25304-newb-question-on-urls/ Share on other sites More sharing options...
gmwebs Posted October 27, 2006 Share Posted October 27, 2006 I guess one benefit is that you can bookmark the page? If you were using POST to navigate around, or session variables, then you would not be able to bookmark the page you were visiting. Quote Link to comment https://forums.phpfreaks.com/topic/25304-newb-question-on-urls/#findComment-115406 Share on other sites More sharing options...
redbullmarky Posted October 27, 2006 Share Posted October 27, 2006 what gmwebs said to an extent is valid. generally though, URL parameters are used to cause a single page to perform multiple tasks - be it different views, features, pages, etc - i.e, a dynamic page.other forms of user input - post ($_POST) for example - arent really suited to this sort of thing, mainly because they require an action from the user (POSTing a form, in this case). URL's like this one can be performed without this type of action. $_GET = what to get from the server, $_POST = what to post to the server.without $_GET, you'd have an index page, a category page, a forum page, a topic page, plus all the additionals that go with it. i like to personally use $_GET to group together pages with a similar function all into one tidy 'package'. there are other benefits too (development, especially) but these are generally the main ones. Quote Link to comment https://forums.phpfreaks.com/topic/25304-newb-question-on-urls/#findComment-115413 Share on other sites More sharing options...
KevinM1 Posted October 27, 2006 Author Share Posted October 27, 2006 Ah, okay, I think I've got it. In the first URL I made, the values sent are handled by viewthread.php, correct? And the links themselves are basically put together by getting the info from the database and appending them to the end of the link. Quote Link to comment https://forums.phpfreaks.com/topic/25304-newb-question-on-urls/#findComment-115423 Share on other sites More sharing options...
redbullmarky Posted October 27, 2006 Share Posted October 27, 2006 pretty much got it in one. forming these URL's isnt restricted to just being formed by the DB, but is definitely the common way. in the case of message boards/forums, etc, this is the case, and normally the id (eg, forum_id, thread_id, etc) relates directly to the primary key of a database record (because it's unique). Quote Link to comment https://forums.phpfreaks.com/topic/25304-newb-question-on-urls/#findComment-115436 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.