Solved

photos on website change based on location

Posted on 2014-04-18
4
352 Views
Last Modified: 2014-04-18
A local bank asked if I could redesign their website.  They have 10 branch offices in different cities.  They want the photos on the website to reflect local people FROM each of those cities and ONLY from those cities.  So, for example, on the home page, there would be a photo of a  couple for X city. ONLY those living in X city would see that photo.  Anyone living in Y city would see the Y photo.  Is that even possible?  I know cell phones are a whole different animal.  So this is really only for desktops.
0
Comment
Question by:nsitedesigns
  • 2
4 Comments
 
LVL 10

Expert Comment

by:Damjan
ID: 40008807
You can try with GeoPlugin - http://www.geoplugin.com/webservices/php
0
 
LVL 52

Accepted Solution

by:
Scott Fell,  EE MVE earned 500 total points
ID: 40008820
It is possible.  However, what I would do is mix in mostly the images from the area we found, then sprinkle in some of the other images.  This way, if by chance the service is off, it does not seem too creepy.

I did some experimenting on my own in a not very scientific way and found smart-ip.net to be the most accurate to price ratio (free).  

It works like this where the x's are the IP http://smart-ip.net/geoip-xml/xx.xx.xx.xx

This can be used as a javascript/jquery ajax request or serverside using asp/php.

One easy way is to grab the county.  If the service shows they are in Kenosha County, then show them the kenosha images and a few of the others.  If they are in Racine County....

If the banks are in the same county but in different towns, the same can be done by town.  

Another option is to figure the nearest branch using some geometry.

In any case, I would also have a default image set that is a mix of everything for when the IP is showing out of range.  

Another option that would be easier is to allow the user to set the default location they are interested in and drop a cookie and based on the cookie show the images for that location.     Perhaps the home page starts out with a random set of images and there is a call out to select the branch closest to you.  

There are multiple ways and no one way will be perfect.    I work with a local bank for my personal account and they have multiple branches where each branch has it's own site.
0
 
LVL 52

Assisted Solution

by:Scott Fell, EE MVE
Scott Fell,  EE MVE earned 500 total points
ID: 40008831
Here is the code in asp

strUrl="http://smart-ip.net/geoip-xml/"&request.ServerVariables("REMOTE_ADDR")
Set xmlHttp =  Server.CreateObject("MSXML2.ServerXMLHTTP.3.0")
    xmlHttp.Open "GET", strUrl, False
    xmlHttp.setRequestHeader "User-Agent", "asp httprequest"
    xmlHttp.setRequestHeader "content-type", "application/x-www-form-urlencoded"
    xmlHttp.Send
    getData = xmlHttp.responseText

response.write getData

Open in new window

0
 

Author Closing Comment

by:nsitedesigns
ID: 40008944
Excellent ideas Scott - thanks for sharing!
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Read about achieving the basic levels of HRIS security in the workplace.
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now