/    Sign up×
Community /Pin to ProfileBookmark

suggestion on a problem

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.

to post a comment
PHP

6 Comments(s)

Copy linkTweet thisAlerts:
@scragarOct 16.2007 — 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.
Copy linkTweet thisAlerts:
@ixxalnxxiauthorOct 16.2007 — what exactly do you mean by "locations", are you speaking of the #map thing in html?
Copy linkTweet thisAlerts:
@scragarOct 16.2007 — 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.
Copy linkTweet thisAlerts:
@ixxalnxxiauthorOct 16.2007 — 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?
Copy linkTweet thisAlerts:
@scragarOct 17.2007 — 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.
[code=html]<html><body><img src="map.png"><img src="house.gif" style="position: relative; top: -20px; left: -30px;"></body></html>[/code]play about with the left and top values till you get the idea.
Copy linkTweet thisAlerts:
@ixxalnxxiauthorOct 17.2007 — thanks for help scragar~
×

Success!

Help @ixxalnxxi spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...