What's the difference between /123 and /?123?
Posted
by BoltClock
on Stack Overflow
See other posts from Stack Overflow
or by BoltClock
Published on 2010-05-28T17:04:59Z
Indexed on
2010/05/28
17:12 UTC
Read the original article
Hit count: 207
I've noticed that some sites (including http://jobs.stackoverflow.com) have query strings that look like this:
http://somewebapp.example/?123
as compared to:
http://somewebapp.example/123 or http://somewebapp.example/id/123
What are the reasons that developers choose to implement their web apps' URLs using the first example instead of the second and third examples?
And as a bonus, how would one implement the first example in PHP, given that 123
is the primary key of some row in a database table? (I just need to know how to retrieve 123
from the URL; I already know how to query the database for a primary key of 123
.)
© Stack Overflow or respective owner