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 Coder
    Join Date
    Jan 2004
    Location
    Boston, MA
    Posts
    23
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Capture IP Address on Submit

    I'm trying to figure out how to capture a user's IP address when they submit a form to purchase items on my website to help prevent fraud. I know there's a way to do this, but what is it? Also, is it even worth it?

  • #2
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    I think that javascript alone can not capture the IP. A server-side application will do the job (SSI, ASP, PHP, JAVA, JSP, C++, Pearl, and so on...)

    See also this

    http://www.hostroute.com/script_ip.html
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #3
    Regular Coder
    Join Date
    Jun 2002
    Posts
    626
    Thanks
    0
    Thanked 0 Times in 0 Posts
    don't most people have their IP addresses assigned dynamically? Those that use Cable and DSL? If that is the case then capturing their IP address would not be helpful.

  • #4
    IBM
    IBM is offline
    New Coder
    Join Date
    Jul 2002
    Posts
    42
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Actuallty, my cable ip addy is static. I can change it at will, buty it remains static. Phone modems on the other hand tend to be dynamic.

    Javascript by itself cannot get an IP, but using Java, Javascript can.
    As well, using an Java Applet you could too.

    I don't remember where I read this, but if you do a google search for 'javascript ip address' +'using java' you might get something helpful.
    But like it has been said, server side scripting is much better at this sort of thing and much easier too. Not too mention javascript and java can be disabled.


  •  

    Posting Permissions

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