Page 1 of 1

Userfriendly URLs?

Posted: Wed Dec 03, 2003 10:31 pm
by nufferkay
I'm working on an event calendaring system for a theater. I really want each show to have its own "user-friendly" url, like http://www.site.org/shows/2003/showname.php rather than http://www.site.org/shows/event.php?event_id=7

How do I do this but also have each show's page pull up data from the database?

I know I can do an include and/or a function call, but it still means that each page needs the show's event_id (or whatever the primary index field ends up being) hardcoded into the page. But that seems even more un-user-friendly (I intend for a computer-savvy but non-developer person to take over day-to-day updates). I just can't imagine a layperson seeking the ID from the database and coding it into each page.

Looking for any and all ideas...

many thanks for any help you can give me.
-Noemi

Posted: Thu Dec 04, 2003 5:36 am
by Weirdan

Posted: Thu Dec 04, 2003 6:39 pm
by nufferkay
Thanks for the link, Weirdan.

Trouble is, I'm on shared hosting and I can't edit the httpd.conf file. Is there a way to do something similar?

-N

Posted: Fri Dec 05, 2003 3:40 am
by dyconsulting
One very simple solution is to substitute / for ?

URL should have following format:
http://www.dyconsulting.com/services.php/search
http://www.dyconsulting.com/services.php/ui

You can parse it like this:

Code: Select all

<?
$page = $_SERVER["REQUEST_URI"];
$page = substr($page, 14);
switch($page) //or you can do whatever you want with that variable
...
?>