Jump to content


Photo

user IP


  • Please log in to reply
6 replies to this topic

#1 pluginbaby

pluginbaby
  • Members
  • PipPipPip
  • Advanced Member
  • 37 posts

Posted 26 August 2006 - 01:09 PM

Is there a PHP Function to get the IP from the users on my site?

#2 shocker-z

shocker-z
  • Members
  • PipPipPip
  • Advanced Member
  • 864 posts
  • LocationNottingham

Posted 26 August 2006 - 01:11 PM

$ip=$_SERVER['REMOTE_ADDR'];

that should do the trick..

Liam
www: www.ukchat.ws | irc: irc.ukchat.ws chan: #blufudge

#3 pluginbaby

pluginbaby
  • Members
  • PipPipPip
  • Advanced Member
  • 37 posts

Posted 26 August 2006 - 01:32 PM

It works perfectly, only, my brother his pc and my pc are on the same network (wireless)and with him the IP shows the same as on my pc.

Is there something that is different for every pc?
And how can I get that?

I want a unique value for every pc ;)

#4 shocker-z

shocker-z
  • Members
  • PipPipPip
  • Advanced Member
  • 864 posts
  • LocationNottingham

Posted 26 August 2006 - 01:36 PM

what is it that tyou are trying to limit? you may be able to use sessions..
www: www.ukchat.ws | irc: irc.ukchat.ws chan: #blufudge

#5 pluginbaby

pluginbaby
  • Members
  • PipPipPip
  • Advanced Member
  • 37 posts

Posted 26 August 2006 - 01:45 PM

I want to prevent that someone has more then 1 account on 1 pc. ;D

Any idea how?

#6 pluginbaby

pluginbaby
  • Members
  • PipPipPip
  • Advanced Member
  • 37 posts

Posted 26 August 2006 - 02:10 PM

<?php

$ip=$_SERVER['REMOTE_ADDR'];

// insert in db

// select from db all players with that id

// if there is more then 1 players with the same IP => set multi status +1

if (empty($_COOKIE['cookie_user'])) {

setcookie("cookie_user","$username",Time()+604800);
}

if ($_COOKIE['cookie_user'] != $username) {

//update multi status: +1

}

// if multi status = 6, send admin a message with the user beeing spotted for multiing

?>

I came up with a basic idea, does this look good?

#7 448191

448191
  • Staff Alumni
  • Advanced Member
  • 3,545 posts
  • LocationNetherlands

Posted 26 August 2006 - 07:40 PM

You can not rely on IP to determin wether a person (or more specificly a pc) has multiple accounts. Some people share their IP, some have dynamic IP's, it simply won't do. Cookies aren't relyable either. It's just a plain file, I (the user) can adjust it as I see fit. Your best option is to bind the users' MAC adress, as it doesn't change (often).

I recently ran into this thread on DevShed that'll give you an insight.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users