Click to See Complete Forum and Search --> : suggestion on a problem


ixxalnxxi
10-16-2007, 03:31 PM
so there's a database with information on different US states, and if the state does exist, a .gif map of the US should display a yellow house over the state.

any suggestions on how i'd go about doing this? i will be able to to test for info in the DB just fine, but how would i use php to rewrite the .gif file to have a home hover about the state? how would i let php know the coords of the state?

thanks.

scragar
10-16-2007, 03:58 PM
you could store the locations in the DB along with state name or whatever, when you read them in use them to position the house or whatever it.

That's the way I'd go about that anyway.

ixxalnxxi
10-16-2007, 04:10 PM
what exactly do you mean by "locations", are you speaking of the #map thing in html?

scragar
10-16-2007, 04:17 PM
it depends on what your doing, but I would put the house image after the map, then use CSS to position it relative, and assign it's top or left atributes given values from the database.
if you can provide more information on how you are doing it I could help with that, without it I'm kinda going of what I see as the best solution, not what your doing.

ixxalnxxi
10-16-2007, 05:54 PM
i see what you're saying, find out each state's location on the page, then for each state i should save their "coordinates" in the DB (their margin from left/right/top/bottom), then if i ever need to put the image on i would load the css' margins fromt he database

is that anywhere in the ballpark of what you're explaining?

scragar
10-16-2007, 09:37 PM
close enough, you should really try to position the two on a new page to see how it works first though.
note, html below doesn't validate, sample purposes only.
<html><body><img src="map.png"><img src="house.gif" style="position: relative; top: -20px; left: -30px;"></body></html>play about with the left and top values till you get the idea.

ixxalnxxi
10-17-2007, 12:21 AM
thanks for help scragar~