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
Userfriendly URLs?
Moderator: General Moderators
- dyconsulting
- Forum Newbie
- Posts: 14
- Joined: Mon Dec 01, 2003 6:52 pm
- Location: San Francisco
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:
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
...
?>