I would like to build a php website and I would like to remove all the strings that make the url to seem dynamic.
However I still need to get information through GET so basically I don’t know how to do that because I need to pass a parameter to $_GET request which obviously would be dynamic . For example I may have http://www.domain.com/mobile_phones where mobile_phones would be the parameter/information that I should get .
Any help would be highly appreciated
I would like to build a php website and I would like to remove
Share
You do this through a process called “routing”. Normally you set up rewrite rule to forward everything to a single entry point –
index.phpthenindex.phpintializes youre application witch makes use of some kind of routing class. This routing class compares theREQUEST_URIto a list of known patterns. When it matches i pattern it takes car of parsing out all the variables form theURI.On the other end of things, to generate the proper urls wihtin the app there are usually a number of helpers that take a series of parameters along with a controller/action and generate a URL based on the same routing rules.
Take a look at the
Zend_Controllerpackage from Zend framework for a good example.