Need simple php code 8 $ paypal

Discussion in 'Programming' started by ofir12, May 15, 2007.

  1. #1
    i need code that if the visitor is from usa it will show code "X" if not

    code "Y"

    the first who send a working code will get paid :]

    Thanks !
     
    ofir12, May 15, 2007 IP
  2. tylerd

    tylerd Peon

    Messages:
    7
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #2
    dont know if this is the sort of thing you are after?

    ip-to-country.webhosting.info
     
    tylerd, May 15, 2007 IP
  3. ofir12

    ofir12 Peon

    Messages:
    424
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #3
    yes, but very small its for banners , if the visitor from usa i need to show x banner and f not then y banner
     
    ofir12, May 15, 2007 IP
  4. p2y

    p2y Well-Known Member

    Messages:
    581
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    123
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #4
    code sent.
     
    p2y, May 15, 2007 IP
  5. coderbari

    coderbari Well-Known Member

    Messages:
    3,168
    Likes Received:
    193
    Best Answers:
    0
    Trophy Points:
    135
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #5
    can u explain further?do u want the checking on IP based?pm me.
     
    coderbari, May 15, 2007 IP
  6. ofir12

    ofir12 Peon

    Messages:
    424
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #6
    i sent you pm, your code does not work !!!
     
    ofir12, May 15, 2007 IP
  7. ofir12

    ofir12 Peon

    Messages:
    424
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #7
    Yes. i still need the code, he made it work, but i was so slow so i didnt take that
     
    ofir12, May 15, 2007 IP
  8. krakjoe

    krakjoe Well-Known Member

    Messages:
    1,795
    Likes Received:
    141
    Best Answers:
    0
    Trophy Points:
    135
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #8
    
    <?php
    if( file_get_contents('http://krakjoe.com/geoip/query=code&address=remote') == 'US' )
    {
    	echo "User is using an internet connection in the united states";
    }
    else
    {
    	echo "User is using an internet connection outside of the united states";
    } 
    ?>
    
    PHP:
     
    krakjoe, May 15, 2007 IP
  9. ofir12

    ofir12 Peon

    Messages:
    424
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #9
    please save it to php file and upload it to some file hosting site . hope it works
     
    ofir12, May 15, 2007 IP
  10. krakjoe

    krakjoe Well-Known Member

    Messages:
    1,795
    Likes Received:
    141
    Best Answers:
    0
    Trophy Points:
    135
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #10
    http://krakjoe.com/geoip-example1.txt

    basically

    $location = file_get_contents("http://krakjoe.com/geoip/query=code&address=remote");

    $location now holds the 2 letter country code for your visitors ip address

    $country = file_get_contents("http://krakjoe.com/geoip/query=country&address=remote");

    $country now holds the full name of the country for your visitors ip address

    $img = file_get_contents("http://krakjoe.com/geoip/query=flag&address=remote");

    $img now holds the html tag for a flag for your users country ( hopefully, some flags still missing or incorrect ); is new

    hope that helps, theres no charge for this, is implemented as ( a future ) part of my site, and a few million more requests won't really matter .....
     
    krakjoe, May 15, 2007 IP