Web Analytics Made Easy -
StatCounter users IP address!!! - CodingForum

Announcement

Collapse
No announcement yet.

users IP address!!!

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • users IP address!!!

    Hello All,

    Okay, I need to get the users IP address, I do not mean the relative one they get everytime they go on the net I want the computer IP address. I am using this code now:

    $_SERVER["REMOTE_ADDR"];

    which returns something like 123.122.153.123

    Thats cool and all but when my user votes on the question if they just restart the internet they can vote again.

    So I need their actual IP address to prevent multiple votes.


    ANY idea is much appreciated!
    CYWebmaster.com - See why we dot com!!
    ACJavascripts.com - Cut & Paste Javascripts!
    SimplyProgram.com - Personal Blog

  • #2
    Restart the internet? Where is this button?

    I'm not sure what you're after, the IP address of a user is just the one contained in $_SERVER['REMOTE_ADDR']. Do you mean the MAC address?
    De gustibus non est disputandum.

    Comment


    • #3
      Hey mordred,

      Well, I ran a test, I would open test.php and save the IP address to my mysql database. Then exit the net (i use AOL) then go back to the script and do it again.

      Once I did this a couple times I pulled the table and each times there was a different IP address.

      Thats not very good for a voting script.

      Now, on this website it doesn't matter if you get off the net or restart once you vote you vote.

      Mabye there using usernames to check, but Im sure theres a way with a IP address. (or mac address but Im not sure what that is)
      CYWebmaster.com - See why we dot com!!
      ACJavascripts.com - Cut & Paste Javascripts!
      SimplyProgram.com - Personal Blog

      Comment


      • #4
        I'm 96% sure that you can't get a computers ID. What you have will have to do.

        Leonard Whistler
        Leonard Whistler

        Comment


        • #5
          The best way around that would be to set a cookie, but of course if the user turns off cookie, that wouldn't work. (though you could require a username/password, but you could get around that too)

          -Andrew
          Get the best Web Design books called Visual QuickStart Guides at the Peachpit Press
          Ithium Web Hosting

          Comment


          • #6
            Because of anonymous proxies and dynamic ips,
            you can't really rely on IP to trace an identity...
            Retreiving the MAC address seems to be a better solution.

            I saw some site getting your mac address, just not sure how they did it.

            Comment


            • #7
              I don't think you can easily get the MAC address, from my point of understanding IP routing, you would only get the address of the last routing point, not the computer which sent the packet originally? Not sure though.

              See also



              If you want to prevent people from cheating your poll script, you'll need them to register by email, and have them confirm every registration. That doesn't prevent fraud by itself, but it makes the hassle greater for those who'd like to submit multiple times and leaves a trail to the cheater.
              De gustibus non est disputandum.

              Comment


              • #8
                THanks everyone, I think I will just have to collect the IP and leave it at that, if it gets to silly I will setup a member system.

                Thanks everyone!!!
                CYWebmaster.com - See why we dot com!!
                ACJavascripts.com - Cut & Paste Javascripts!
                SimplyProgram.com - Personal Blog

                Comment


                • #9
                  what you could do is put a cookie on that person's computer (see setcookie() function) and if that cookie exists, then don't allow that person to vote.
                  Ithium | FootyMania.com

                  Comment


                  • #10
                    That would work for a bit, but the user only has to remove the cookie from there temp folders and they can vote again.
                    CYWebmaster.com - See why we dot com!!
                    ACJavascripts.com - Cut & Paste Javascripts!
                    SimplyProgram.com - Personal Blog

                    Comment


                    • #11
                      think about it though... there is no way to stop someone voting twice or more times, if you setup the IP and cookie that should be enough... If someone really wants to annoy you they are going to get bored disconnecting, reconnecting and deleting cookies!
                      PHP Weekly - A PHP Developers Resource
                      PHP 5.1.4 and Ruby on Rails web hosting
                      Moderator of PHP and Work offers and Requests
                      Install Apache/PHP/MySQL
                      (by marek_mar) | TinyPlugin Architecture

                      Comment


                      • #12
                        You Could Just Use Wildcards :-/

                        for Example: 127.0.0.*
                        ~imaekphp

                        Comment


                        • #13
                          That would work for a bit
                          Yeah, but if ppl would really go through the trouble of deleting cookies to just vote, you can imagine that they will go through the trouble to do anything to vote. The only way you can truly ensure that they don't revote is using a login system, where each person has to register, but even after that, it's hard, since the person can create multiple accounts. Maybe login for only one UNIQUE email address.
                          Ithium | FootyMania.com

                          Comment


                          • #14
                            The login system is probably the best way to go about it with the unique emails.

                            I dont know about your guys/gals computers but when I restart my computer all my cookies are removed.

                            I didn't want to go and code a member system

                            but I gues I am going to have to hehehe
                            CYWebmaster.com - See why we dot com!!
                            ACJavascripts.com - Cut & Paste Javascripts!
                            SimplyProgram.com - Personal Blog

                            Comment


                            • #15
                              Originally posted by duniyadnd
                              Maybe login for only one UNIQUE email address.
                              Then people would just register multiple hotmail or yahoo accounts.

                              Unfortunately, there is no surefire way to keep anyone from voting more than once unless you control the entire network of computers that people can vote on (say, for example, electronic voting booths that are starting to become more frequent here in the US)

                              -Andrew
                              Get the best Web Design books called Visual QuickStart Guides at the Peachpit Press
                              Ithium Web Hosting

                              Comment

                              Working...
                              X