Barry Margolin <barmar@alum.mit.edu> writes:
bit-naughty@hotmail.com wrote:
I just got a bill on my phone, which said "To pay this bill - go to
www.<whatever>" . When I went to the site - it said stuff like
"Welcome Mr. John Doe", ie. it *knew from the URL* that it was me!
I'm kind of trying to figure out how this was architected - can you
guys help? :)
MY brain suggested something like this: whatever was after the "/"
in the URL (something like e2gbm853dc or whatever) was an ARGUMENT -
when someone types that in to the browser, it redirects to
script.php (or whatever) on the server with THAT string as the
argument. Which, by querying for that row in a SQL database or
something, brings up my name in the company's database..... am I on
the right track here?
Yes, that's basically how it works. Webservers typically use rewrite
rules to move path components to script parameters, so a URL like:
https://www.example.com/paybill/e2gbm853dc
could be translated to:
https://www.example.com/paybill.php?id=e2gbm853dc
and then the script does the database lookup to find you.
[Cross-posting to news:comp.infosystems.www.misc, for reasons.]Barry Margolin <barmar@alum.mit.edu> writes:
bit-naughty@hotmail.com wrote:
Yes, that's basically how it works. Webservers typically use rewrite rules to move path components to script parameters, so a URL like: https://www.example.com/paybill/e2gbm853dc
could be translated to:
https://www.example.com/paybill.php?id=e2gbm853dc
Or the Web server could be configured so that whenever it sees a
URI starting with "/paybill", it starts (or contacts, for
FastCGI) the script, which then has access to either the
original URI in its entirety, or at least the part after the
script's name.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 185 |
Nodes: | 16 (2 / 14) |
Uptime: | 08:51:31 |
Calls: | 3,651 |
Calls today: | 7 |
Files: | 11,145 |
Messages: | 3,445,099 |