Ten Ways to Use PHP On Your Website

eLearning Series

by

Customer Paradigm
888.772.0777
303.499.9318

Thanks for all of the feedback about the new series last week - it sounds like this is a great topic for many people. This week, we'll explore how php programming can be used to customize a website, depending on where a user is visiting from. Read more below >>

Ten Ways to Use PHP On Your Website
Tip #2: PHP Programming & Geolocation

Websites That Can Track Your Location

Each time you connect to a Website, your computer sends your IP address to the server, so that the content of the Web page can be delivered back to you. An IP address is just a set of four pairs of numbers, connected with dots. For example, one of our server's IP addresses is 69.94.12.212.

When your computer connects to a website, usually the IP address is just used so that the Web server knows what computer to send each web page to. This has been true since the beginning of the Web.

However, using the PHP programming language, you can take someone's IP address and check it against a database of IP addresses, so that you can know the geographic location of the user, and then take specific actions based on the request.

How Does This Work?

  • When you visit a website, your computer sends your IP address to the website.
  • The website takes the IP address, and looks up the number in an online database.
  • The database will return a result (i.e. United States)
  • With the country information, you can then take further actions with the php programming language to personalize the web page based on the user's location.

Why Care About Geolocation?

If you are able to tell where someone is coming from (i.e. US, Canada, or France), you can tailor the site to your target audience.

One site, DiscountDecorating.com, automatically detects if you are coming in from the US, Canada or Europe, and then based on this information, personalizes the site:

  • If you're visiting the site from the US, the site displays an animation that talks about free shipping in the continental US.
  • If you're visiting from Canada, the site features a toll-free number that works in Canada.
  • And for people visiting from outside the US, the site informs visitors that they are happy to ship worldwide.

Most of the geolocation databases are very accurate when it comes to country. They're a lot less accurate for individual states, and pretty inaccurate on a city-by-city basis. Sometimes this is because a company like Comcast's use IP connections in New Jersey. That said, certain companies like Google have very sophisticated geolocation databases, but for smaller websites they tend to be prohibitively expensive.

Speak To Customers In Their Language

Another way to use a geolocation database to determine what language you should display to visitors when they come to your site. Anyone visiting from Mexico, for example, might receive the Spanish language version of the site, while someone in France would receive the French version. We recommend giving people an easy way to find their way back to other languages, however, with text links at the top of the page.

Summary:

With an interactive language like PHP, you can take a basic piece of information (like an IP address), and combine it with the power of an online database to create a compelling, tailored experience.

 

I hope you enjoyed this first part of the series. Let me know if you'd like to explore how php can take your website to the next level of interactivity.

Talk to you soon,

Jeff FinkelsteinFounder, Customer Paradigm

Jeff Finkelstein

Founder, Customer Paradigm

Connect Via Facebook >>
Connect Via Linked In >>

We love referrals! Our Referral Promise >>

Customer Paradigm
5353 Manhattan Circle, Suite 103
Boulder, Colorado 80303
Visit our Website
direct 303.499.9318
fax 303.374.6104
toll free 888.772.0777
Web & Print Design · Programming · Email Newsletters · Search Engine Marketing · eCommerce

 

<< back to list of Ten Ways to Use PHP Programming on Your Website

Sign Up to Receive these Strategies in your Inbox:

  • Please fill out the form on this page to sign up.
    The emails usually go out on Friday mornings.

Please have someone contact me regarding these strategies:

First Name :
Last Name :
Phone :
Email :
Comments :
 
  Word Verification:
  Enter the word as it is
shown in the box to the right.

 This step is required to prevent abuse of our services.