|
Posted by Richard Lynch on 05/15/05 06:40
On Sat, May 14, 2005 12:25 am, john@johnallsopp.co.uk said:
>> For example:
>>
>> mysite/sweaters/
>>
>> (I think) is better than:
>>
>> mysite/index.php?section=1&content=23&style=5.
>
> It's more usable I guess. What handles that though? I'm finding it
> hard to organise the back end of that in my head.
>
> I don't think there's any way around that ending up looking for an
> index file in the sweaters directory. So then you're ending up with
> lots of index files. Maybe they could redirect to the one program that
That's where you are wrong. :-)
'sweaters' isn't a directory.
It's not even a file.
It's a URL.
The file that *handles* that URL is index.php
You do NOT have a one-to-one mapping from URL to file, nor even from what
looks like a directory to a URL.
Consider these pages:
http://uncommonground.com/artist_profile/Ellen+Rosner
http://uncommonground.com/artist_profile/gray
http://uncommonground.com/artist_profile/TRAIN
http://uncommonground.com/artist_profile/David+Gray
You don't think I build 2000 of those things, do you?
artist_profile is the PHP script.
It tears apart $_SERVER['PATH_INFO'] and figures out which artist you
want, or gives you a list to choose from if more than one matches.
Another most excellent example of this kind of thing can be found all over:
http://cdbaby.com/
Every URL you surf to there is really a PHP script. I dunno which ones
he's got in actual directories, and which ones are actually PHP scripts,
but I don't care. I can remember the URL, which is all I, as the user,
cares about.
--
Like Music?
http://l-i-e.com/artists.htm
[Back to original message]
|