Welcome Guest, Not a member yet? Register   Sign In
URL Rewriting: Name instead of ID
#11

[eluser]KingSkippus[/eluser]
[quote author="mddd" date="1279731640"]Then the topicstarter should just stick to using id's. I don't see the value in using names instead of id's, but encoding the names in a way that is hard to read by the user.[/quote]

I agree, the OP probably really should stick to using ids. Otherwise, he or she is asking for a royal PITA when users go guessing what to enter as the URL. Should they enter:

- .../john_doe?
- .../john doe?
- .../john-doe?
- .../john%20doe?
- .../johndoe?
- .../John_Doe?
- .../JohnDoe?
- ...

Not to mention, what happens if you have two John Does in your database? Are you going to resort to .../john_doe and .../john_doe2? That's not user-friendly at all.

Don't get me wrong, I'm not strictly opposed to using a URL like .../john_doe, because it does give the user an inkling of what to expect if they click on it--information about somebody named John Doe. Typically, though, I only do this if the database key field I'm looking up is actually john_doe and not some numeric id. Again, having readable URLs is gravy, but in the end, the programmer should worry more about how to uniquely use them to identify the information they need to get and present the information to the user, not letting users guess what URLs will be.


Messages In This Thread
URL Rewriting: Name instead of ID - by El Forum - 07-20-2010, 04:50 AM
URL Rewriting: Name instead of ID - by El Forum - 07-20-2010, 05:03 AM
URL Rewriting: Name instead of ID - by El Forum - 07-20-2010, 05:05 AM
URL Rewriting: Name instead of ID - by El Forum - 07-20-2010, 05:05 AM
URL Rewriting: Name instead of ID - by El Forum - 07-20-2010, 07:20 AM
URL Rewriting: Name instead of ID - by El Forum - 07-20-2010, 06:41 PM
URL Rewriting: Name instead of ID - by El Forum - 07-20-2010, 07:25 PM
URL Rewriting: Name instead of ID - by El Forum - 07-21-2010, 01:16 AM
URL Rewriting: Name instead of ID - by El Forum - 07-21-2010, 05:57 AM
URL Rewriting: Name instead of ID - by El Forum - 07-21-2010, 06:00 AM
URL Rewriting: Name instead of ID - by El Forum - 07-21-2010, 06:08 AM
URL Rewriting: Name instead of ID - by El Forum - 07-21-2010, 06:11 AM
URL Rewriting: Name instead of ID - by El Forum - 07-21-2010, 07:54 AM
URL Rewriting: Name instead of ID - by El Forum - 07-21-2010, 07:58 AM
URL Rewriting: Name instead of ID - by El Forum - 07-21-2010, 12:25 PM
URL Rewriting: Name instead of ID - by El Forum - 07-26-2010, 10:47 AM



Theme © iAndrew 2016 - Forum software by © MyBB