Solved

photos on website change based on location

Posted on 2014-04-18
4
370 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 10

Expert Comment

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

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 53

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

Enroll in June's Course of the Month

June’s Course of the Month is now available! Experts Exchange’s Premium Members, Team Accounts, and Qualified Experts have access to a complimentary course each month as part of their membership—an extra way to sharpen your skills and increase training.

Question has a verified solution.

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

Although a lot of people devote their energy toward marketing for specific industries, there are some basic principles that can be applied to any sector imaginable. We’ll look at four steps to take and examine how those steps were put into action fo…
When it comes to security, close monitoring is a must. According to WhiteHat Security annual report, a substantial number of all web applications are vulnerable always. Monitis offers a new product - fully-featured Website security monitoring and pr…
This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…
The viewer will learn how to count occurrences of each item in an array.

718 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