?
Solved

photos on website change based on location

Posted on 2014-04-18
4
Medium Priority
?
381 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 55

Accepted Solution

by:
Scott Fell,  EE MVE earned 2000 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 55

Assisted Solution

by:Scott Fell, EE MVE
Scott Fell,  EE MVE earned 2000 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

This article is about the challenges faced by Android app developers.
I recently worked on a Wordpress site that utilized the popular ContactForm7 (https://contactform7.com/) plug-in that only sends an email and does not save data. The client wanted the data saved to a custom CRM database. This is my solution.
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Planning to migrate your EDB file(s) to a new or an existing Outlook PST file? This video will guide you how to convert EDB file(s) to PST. Besides this, it also describes, how one can easily search any item(s) from multiple folders or mailboxes…

589 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