Forum Moderators: coopster
I want to go from something like page.php?car_id=1223 to /make/duesenberg/model/1934-dual-cowl-phaeton/page.php (or whatever they best format is, especially for dealing with spaces.)
Thanks!
The uniqueID at the end of the file name will stop clashes with simlar named pages.
In your database you have the fields
UniqueID ,Car_Title, Page_Name, etc
Page_Name being automatically generated from the the first 2 columns.
When you retrieve the information from the database instead of it coming out like
page.php?id=232
it comes out as
Car_Title_UniqueID.php
When that page loads you then need to do a check into the database for the entry with Page_Name=The current file name. You then store the ID of that entry as a Session or Global variable and use it as if it had been entered as a GET variable.
hope that makes sense,
Hughie
Having just done something along the lines of mod_rewrite, your problem is easily solved by just rewriting the id to /id/####.
If you're looking to provide all that information in the string though, you'll have to adjust the data presented to the script. If you have the data available on previous pages to supply the link for '/make/duesenberg/model/1934-dual-cowl-phaeton/page.php', and your destination script can take the information, go that route..
But, if all you have is an car_id variable and everything is specialized for that, the way of lesser headaches is going through /car/id/#####.
I hope this helps. I'm not sure if mod_rewrite can do queries on its own to find your desired ID. Then again, you could always write a php to do a lookup for the given car information, assign the id, then include the php that presents the information..
-C