Jump to content

Newb question on URLs


KevinM1

Recommended Posts

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?
Link to comment
Share on other sites

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.
Link to comment
Share on other sites

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).
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.