+ Reply to Thread
Page 1 of 2
1 2 LastLast
Results 1 to 10 of 11

Thread: IP Location with PHP

  1. #1
    Moderator Jaan is a splendid one to behold Jaan is a splendid one to behold Jaan is a splendid one to behold Jaan is a splendid one to behold Jaan is a splendid one to behold Jaan is a splendid one to behold Jaan is a splendid one to behold Jaan's Avatar
    Join Date
    Dec 2006
    Location
    Estonia
    Age
    19
    Posts
    2,044
    Blog Entries
    13

    IP Location with PHP

    Last edited by Jaan; 06-08-2010 at 09:28 AM.

  2. #2
    Administrator Jordan is a name known to all Jordan is a name known to all Jordan is a name known to all Jordan is a name known to all Jordan is a name known to all Jordan is a name known to all Jordan's Avatar
    Join Date
    Nov 2005
    Location
    Hendersonville, NC
    Posts
    24,751
    Blog Entries
    97

    Re: IP Location with PHP

    Very cool and useful tutorial! Nice work Jaan. This would be handy in many situations. If you wanted to restrict ads by location or allow (or block) a country, etc.

    +rep!

  3. #3
    Moderator Jaan is a splendid one to behold Jaan is a splendid one to behold Jaan is a splendid one to behold Jaan is a splendid one to behold Jaan is a splendid one to behold Jaan is a splendid one to behold Jaan is a splendid one to behold Jaan's Avatar
    Join Date
    Dec 2006
    Location
    Estonia
    Age
    19
    Posts
    2,044
    Blog Entries
    13

    Re: IP Location with PHP

    yup yup mate.. I'm using this kind of technique in AdStar also.. but little bit.. well much complicated script but yes it's useful.. then you know who visits your site.. and things

    thanks mate

  4. #4
    Code Warrior BlaineSch is a name known to all BlaineSch is a name known to all BlaineSch is a name known to all BlaineSch is a name known to all BlaineSch is a name known to all BlaineSch is a name known to all BlaineSch's Avatar
    Join Date
    Apr 2009
    Location
    Trapped in my own little world.
    Age
    20
    Posts
    2,247
    Blog Entries
    8

    Re: IP Location with PHP

    Yes I could see this being helpful with stats and ad management.

    What kind of program are you making?

  5. #5
    Administrator Jordan is a name known to all Jordan is a name known to all Jordan is a name known to all Jordan is a name known to all Jordan is a name known to all Jordan is a name known to all Jordan's Avatar
    Join Date
    Nov 2005
    Location
    Hendersonville, NC
    Posts
    24,751
    Blog Entries
    97

    Re: IP Location with PHP

    You can also use the PEAR package to determine location: Net_GeoIP OR Net_Geo

    I just came across these in the PEAR db.

  6. #6
    Super Moderator WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther's Avatar
    Join Date
    Jul 2006
    Age
    37
    Posts
    12,912
    Blog Entries
    57

    Re: IP Location with PHP

    Cool! +rep
    CodeCall Blog | CodeCall Wiki
    Programming is a branch of mathematics.
    My CodeCall Blog | My Personal Blog

  7. #7
    Moderator Jaan is a splendid one to behold Jaan is a splendid one to behold Jaan is a splendid one to behold Jaan is a splendid one to behold Jaan is a splendid one to behold Jaan is a splendid one to behold Jaan is a splendid one to behold Jaan's Avatar
    Join Date
    Dec 2006
    Location
    Estonia
    Age
    19
    Posts
    2,044
    Blog Entries
    13

    Re: IP Location with PHP

    Oh thanks mate

  8. #8
    Code Slinger chili5 has a reputation beyond repute chili5 has a reputation beyond repute chili5 has a reputation beyond repute chili5 has a reputation beyond repute chili5 has a reputation beyond repute chili5 has a reputation beyond repute chili5 has a reputation beyond repute chili5 has a reputation beyond repute chili5 has a reputation beyond repute chili5 has a reputation beyond repute chili5 has a reputation beyond repute chili5's Avatar
    Join Date
    Mar 2008
    Posts
    7,035

    Re: IP Location with PHP

    Very cool! This is great, I can use this in my project and avoid having to store the countries in my database.

    +rep for you!
    "Whenever you remember, I'll be there/
    Remember how we reached that dream together" - Carrie Underwood

  9. #9
    Newbie azoqup is an unknown quantity at this point
    Join Date
    Apr 2009
    Posts
    6

    Re: IP Location with PHP

    Hello,

    $select_db = mysql_select_db("ip", $con); ///////// import.php

    $select_db = mysql_select_db("iploc"); ///// checkip.php

    i just going to learn this script from your tutorial but i saw this ambiguous lines.
    Is this a writing mistake or it meanings something else cause two different db. Anyway excuse me if i am wrong.

    oh one thing why you use backtick operator in mysql query.

    thank you.

  10. #10
    Moderator Jaan is a splendid one to behold Jaan is a splendid one to behold Jaan is a splendid one to behold Jaan is a splendid one to behold Jaan is a splendid one to behold Jaan is a splendid one to behold Jaan is a splendid one to behold Jaan's Avatar
    Join Date
    Dec 2006
    Location
    Estonia
    Age
    19
    Posts
    2,044
    Blog Entries
    13

    Re: IP Location with PHP

    Oh yes.. There was a mistake.. "iploc" is a database that is in my localhost.. I tested this script there.. and I forgot it there.. thanks for noticing

+ Reply to Thread
Page 1 of 2
1 2 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. PHP 5 and OOP
    By Jordan in forum PHP Tutorials
    Replies: 11
    Last Post: 09-21-2008, 10:58 PM
  2. Beginners Guide To PHP: *Tutorial*
    By renlok in forum PHP Tutorials
    Replies: 3
    Last Post: 04-22-2008, 12:20 PM
  3. PHP 4 end of life announcement
    By Jordan in forum News
    Replies: 4
    Last Post: 08-30-2007, 06:55 AM