Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Aug 2008
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Use JavaScript to display content based on ip address

    New to any programming.

    I am trying to display a specific picture to a visitor based on their IP Address. I.e., if the ip is x.xx.xxx.x display a picture of a dog. If the ip is y.yy.yyy.y display a picture of a cat, etc. Need to use server-side content.

    Thanks

  2. #2
    Senior Coder shyam's Avatar
    Join Date
    Jul 2005
    Posts
    1,563
    Thanks
    2
    Thanked 163 Times in 160 Posts
    you should check out javax.servlet.http.HttpServlet.getRequestAddr()

    ps. you cannot do it in javascript
    Last edited by shyam; 08-16-2008 at 03:41 PM.
    You never have to change anything you got up in the middle of the night to write. -- Saul Bellow

  3. #3
    New to the CF scene
    Join Date
    May 2013
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    use can use tools at geolify.com t do what you need. it helps create geo targeted content for your website with minimal coding. you can also use it to do geo redirects based on ip address of visitors

  4. #4
    New to the CF scene
    Join Date
    May 2013
    Location
    www.ballbearingcorp.com
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    First you need to get users ip, it's easier to get it in java in server , it's hard to get ip in javascript.


 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •