kee2ka4 Posted August 12, 2008 Share Posted August 12, 2008 Hello everyone, I am a newbie in php and have made a couple of basic applications. Hence I needed some advise on my next project. I am working on a classified ad site and needed some thought process on the different countries and cities concept. Basically, I want to make the site load by country prefix. So for example if I type the url www.sitename.co.uk then it loads the site displaying only adverts listed in uk, and further most if someone changes the city to london, then the url location changes to london.sitename.co.uk and only lists adverts in London. Similarly if the site name is www.sitename.com then it displays adverts listed in USA and the same concept as above for cities so newyork.sitename.com will display adverts in New York city. Can someone share ideas on the best way to implement this feature. Thanks, Ket Quote Link to comment Share on other sites More sharing options...
steelmanronald06 Posted August 18, 2008 Share Posted August 18, 2008 When you call the page have it read the URL and match it against a database, and pull all the rows from the table matching the url column. What I would do is have a table called adverts set up like so: Table adverts: ad_id country city ad From the URL grab the .co.uk (or whatever) and match against country. If there is something before sitname.co.uk (or whatever...ex: london.sitename.co.uk) have it match both the country and the city. From there just pull down information and print it out. As far as file system goes, you'll probably only have files that are basic templates, and the entire site ran as a backend. For this, look into a framework. I really like Cakephp. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.