Hmmm, how to say this in 20 words or less.
The variable you see passed is normally a key in a table (if using a database), and the page is dynamically built using that key to isolate the specific row(s) required. Example is the calendar that I'm working on. If I were to hard code it, I would have to create one page per calendar set, an impossibly labor intensive task depending on how many months/years I want to go into the future and the past. Instead, I will create one page that is passed a date. The page looks for the date, if it is there, the calendars and events listing are based on it, if it isn't, the page defaults to the current date.
When calling the calendar, the URL is calendar.php4?2001-03-06 (using the MySQL date format, you can differ if you want.
The page takes the date from the query string, parses it and manipulates it so I can get two inclusive dates (the first and last date of the calendar set, which could range from 1-6 months), and then applies those two dates to the following SQL statement:
$strSQL = "SELECT StartDate, EndDate FROM event WHERE (StartDate <= " .
"'$varStartDate' AND EndDate >= '$varStartDate') OR (StartDate >= '$varStartDate' AND StartDate " .
"<= '$varEndDate') AND Approved='true'";
There is a whole lot more to it than that, but this should give you an idea.
The key here is whatever you pass in the query string should be a key field in your table.
Of course, the info passed in the query string doesn't have to be database fields, it could be info used to set page settings, like color and graphics. You could pass a number that tells a conditional statement which part of the statement to execute:
if($submit == 0) {
do something this time around...
} elseif($submit == 1) {
do something else because we finished part 1
} else {
do this now that we finished part 3
}
One thing you might do in that last example is to pass additional information in the query string to execute additional steps:
something.php4?submit=0
something.php4?submit=1&name=Doe
You don't have to necessarily pass the info in the query string, you could post it instead. I find personally that passing information in the query string is good if I need to create links that go to dynamic pages. If I am sending info via a form, I will use the POST method instead.
One thing you should pass in the query string, though, is the SID (if you're using sessions) just in case the user has cookies turned off. Yeah, it says somewhere that this is done automatically, but I personally don't feel like taking chances.
I don't personally know of any sites off hand, but I am sure someone out there does.
Of course, this is all my opinion, but I hope it helps.
Jim Hawley