Alert icon
We're changing our privacy policy. This stuff matters.  Learn more  Dismiss

PHP in HTML (Visitor country by IP filter)

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
1,219
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Jul 18, 2010

Put PHP code in your HTML pages by adding a directive in your .htaccess file. This example uses PHP to present custom content based on the country of the visitor using IP address to country database. No MySQL needed for this code.

Bug: the array values from explode function must be converted to int. PHP is comparing them as strings which means 234 is greater than 1234. Add (int) before the variable.

Ok so i dont use this anymore. There is a complete solution from maxmind using geoip.inc but his was a fun little project to try out for my first (maybe last) php programming adventure. Anyway here is the php code ...
http://fibzilla.com/example.txt

Category:

Education

Tags:

License:

Standard YouTube License

Link to this comment:

Share to:
see all

All Comments (0)

Sign In or Sign Up now to post a comment!
Loading...

Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more