pluginbaby Posted August 26, 2006 Share Posted August 26, 2006 Is there a PHP Function to get the IP from the users on my site? Link to comment https://forums.phpfreaks.com/topic/18720-user-ip/ Share on other sites More sharing options...
shocker-z Posted August 26, 2006 Share Posted August 26, 2006 $ip=$_SERVER['REMOTE_ADDR'];that should do the trick..Liam Link to comment https://forums.phpfreaks.com/topic/18720-user-ip/#findComment-80709 Share on other sites More sharing options...
pluginbaby Posted August 26, 2006 Author Share Posted August 26, 2006 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 ;) Link to comment https://forums.phpfreaks.com/topic/18720-user-ip/#findComment-80717 Share on other sites More sharing options...
shocker-z Posted August 26, 2006 Share Posted August 26, 2006 what is it that tyou are trying to limit? you may be able to use sessions.. Link to comment https://forums.phpfreaks.com/topic/18720-user-ip/#findComment-80718 Share on other sites More sharing options...
pluginbaby Posted August 26, 2006 Author Share Posted August 26, 2006 I want to prevent that someone has more then 1 account on 1 pc. ;DAny idea how? Link to comment https://forums.phpfreaks.com/topic/18720-user-ip/#findComment-80723 Share on other sites More sharing options...
pluginbaby Posted August 26, 2006 Author Share Posted August 26, 2006 [code]<?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 +1if (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?>[/code]I came up with a basic idea, does this look good? Link to comment https://forums.phpfreaks.com/topic/18720-user-ip/#findComment-80733 Share on other sites More sharing options...
448191 Posted August 26, 2006 Share Posted August 26, 2006 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 [url=http://forums.devarticles.com/general-programming-help-4/how-can-i-find-out-the-user-mac-address-1846.html]this[/url] thread on DevShed that'll give you an insight. Link to comment https://forums.phpfreaks.com/topic/18720-user-ip/#findComment-80841 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.