Jump to content

Display list relevant to passed parameter


kurt.santo

Recommended Posts

Have created two tables: one for regions with column region and region_id, the other one for counties with county, county_id and region_id. In webpage I created this nice image-map with hotspots around the regions. I have assigned each hotspot with relevant url (for example href="?region=8").My question: what would be the best way to update page content, so when user clicks onto a region a list of relevant counties is displayed with the message "Please select a region" changing to "Please choose a county" with an additional "or select another region from the map" underneath the list?In list I would like to have the region and individual counties listed with a count of the companies listed in those. There is a table that just associates the companies with the counties.KurtReason for edit: forgot one question. What structure would be best to store photos relevant to a company? Would it be an idea to have folders as main (feature photo) and thumbnail and then inside those have a subfolder with id of company? Or would it be sufficient to just have inside main and thumbnail photos stored as 1_5894, 2_5897, 1_9213 where the second part is the id of the company?

Link to comment
Share on other sites

well, since you are already using the hotspot to send a region through the urluse $_REQUEST or $_GET to dynamically change the pageif (isset($_GET['region'])){// do whatever you want with the text i.e dropdown menu,links, data pulled out of the DB..etc echo "Please choose a country"; echo "or select another region from the map";}else{// a region was not selectedecho " Please select a region";}not sure about the photo question ... and i hope i am picturing how you want this to work right

Link to comment
Share on other sites

well, since you are already using the hotspot to send a region through the urluse $_REQUEST or $_GET to dynamically change the pageif (isset($_GET['region'])){// do whatever you want with the text i.e dropdown menu,links, data pulled out of the DB..etc echo "Please choose a country"; echo "or select another region from the map";}else{// a region was not selectedecho " Please select a region";}not sure about the photo question ... and i hope i am picturing how you want this to work right
Thanks for your input. Thats a good start. Do you know by any change what would be the best way to display the list items (counties of a region), so that when you click onto one you come to a different page, which lists all companies, whose id is linked to choosen county in company-county relation table? Or do you know a good tutorial to do just that?Kurt
Link to comment
Share on other sites

well, depending if you are trying to conserve space on your page i'd go with a dropdown menuif you have the space I'd print them all in a box (div, table or something) using a while loop so that the link for each can send through the country (through the url like before) and have that page (the one it goes to, maybe even itself) print out the companies from grabbing the country in the urlI prefer GET when there is no real reason to hide the information...I like to see it move along through the url. Then if i decide later just go back and use the POST method (looks nicer too, besides some crazy long url)anyway Kurt, hope this helps a bitsorry took a bit to get back to you ...had some work to get done and had to find this post again.

Link to comment
Share on other sites

I prefer GET when there is no real reason to hide the information...I like to see it move along through the url. Then if i decide later just go back and use the POST method (looks nicer too, besides some crazy long url)
Don't worry, I appreciate you help. Somethings are worth waiting for...I did not really get the above bit. Could you explain what you meant? I am still very new to dynamic programming (or any programming to tell you the truth), so sometimes I still do not get the basic ideas...Kurt
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...