Solved

photos on website change based on location

Posted on 2014-04-18
4
355 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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Envision that you are chipping away at another e-business site with a team of pundit developers and designers. Everything seems, by all accounts, to be going easily.
Any business that wants to seriously grow needs to keep the needs and desires of an international audience of their websites in mind. Making a website friendly to international users isn’t prohibitively expensive and can provide an incredible return…
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…

914 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

18 Experts available now in Live!

Get 1:1 Help Now