tfraser Posted August 1, 2011 Share Posted August 1, 2011 Hi everyone, I am currently building a uk job board in php. I want to allow people to browse jobs based on location. Currently I have all the locations stored in an xml file and inserted into a drop down box. The xml file looks like this; <?xml version="1.0"?> <dropdownmenu> <item>United Kingdom</item> <item>--- England</item> <item>--- --- East</item> <item>--- --- --- Cambridgeshire</item> <item>--- --- --- Norfolk</item> <item>--- --- --- Suffolk</item> <item>--- --- Greater London</item> <item>--- --- --- Central London</item> <item>--- --- --- East London</item> <item>--- --- --- North London</item> <item>--- --- --- South London</item> <item>--- --- --- West London</item> <item>--- --- Midlands</item> <item>--- --- --- Derbyshire</item> <item>--- --- --- Herefordshire</item> <item>--- --- --- Leicestershire</item> <item>--- --- --- Lincolnshire</item> <item>--- --- --- Northamptonshire</item> <item>--- --- --- Nottinghampshire</item> <item>--- --- --- Shropshire</item> <item>--- --- --- Staffordshire</item> <item>--- --- --- Warwickshire</item> <item>--- --- --- West Midlands</item> <item>--- --- --- Worcestershire</item> <item>--- --- North East</item> <item>--- --- --- Durham</item> <item>--- --- --- Northumberland</item> <item>--- --- --- Tyne and Wear</item> <item>--- --- --- Yorkshire and Humberside</item> <item>--- --- North West</item> <item>--- --- --- Cheshire</item> <item>--- --- --- Cumbria and Isle of Man</item> <item>--- --- --- Greater Manchester</item> <item>--- --- --- Lancashire</item> <item>--- --- --- Merseyside</item> <item>--- --- South East</item> <item>--- --- --- Bedfordshire</item> <item>--- --- --- Berkshire</item> <item>--- --- --- Buckinghamshire</item> <item>--- --- South West</item> <item>--- --- --- Avon</item> <item>--- --- --- Cornwall</item> <item>--- --- --- Devon</item> <item>--- --- --- Dorset</item> <item>--- --- --- Gloucestershire</item> <item>--- --- --- Somerset</item> <item>--- --- --- Wiltshire</item> <item>--- Northern Ireland</item> <item>--- Scotland</item> <item>--- --- Angus</item> <item>--- --- Argyllshire</item> <item>--- --- Ayrshire</item> <item>--- --- Borders</item> <item>--- --- Central Region</item> <item>--- --- Dumfries and Galloway</item> <item>--- --- Dumbartonshire</item> <item>--- --- East Scotland</item> <item>--- --- Edinburgh and Lothians</item> <item>--- --- Fife</item> <item>--- --- Glasgow</item> <item>--- --- Grampian</item> <item>--- --- Highland and Islands</item> <item>--- --- Inverclyde</item> <item>--- --- North Scotland</item> <item>--- --- Renfrewshire</item> <item>--- --- Tayside</item> <item>--- --- West Scotland</item> <item>--- Wales</item> <item>Republic of Ireland</item> </dropdownmenu> My problem is that I need all the sub-areas to display when one of the larger areas is selected, so for example if someone were to click 'England' it would search all jobs linked to the smaller areas. Would anyone be able to point me in the right direction as how to store this country data, and then how to search my mysql database to find all relevant jobs based on location and sub locations. Thanks in advance! Quote Link to comment Share on other sites More sharing options...
voip03 Posted August 1, 2011 Share Posted August 1, 2011 google it http://www.webreference.com/programming/php/search/ Quote Link to comment Share on other sites More sharing options...
tfraser Posted August 2, 2011 Author Share Posted August 2, 2011 Anyone with a slightly more constructive answer please? It is not that I don't know how to create a search in php, it is that I do not know how to store the information so that subsections are also searched and also how is should be constructing other parts of my code?. Do I need to store the information differently in my xml files? Any point in the right direction about how this can be done would be great! Thanks 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.