1

Topic: IP logger for better security

I've found a script to log the users IP adresses.
Now trying to get it into VLD...

<?
// defineer bestand waarin ip's worden opgeslagen
// doe dit bestand: chmod 777
$file = "cfgs/ip.dat";

// pak het ip adres
$addr = $_SERVER['REMOTE_ADDR'];

// open bestand voor "append" (=toevoegen op einde)
$openfile = fopen($file, "a");
// schrijf het IP-adres
fputs($openfile, "$addr<br>\n");
// sluit het bestand
fclose($openfile);
?>
http://forum.pcmweb.nl/archive/index.php/t-7724.html

Last edited by godyn (2010-06-26 04:24:10)

2

Re: IP logger for better security

to log the ip when they register ?

3

Re: IP logger for better security

Its already there at registration.

4

Re: IP logger for better security

no I'm looking to have a history of users IP log, that would be handy to track fakes.

5

Re: IP logger for better security

so what you are saying is to record users IP when logging in and keep a record of like the last 5 IP`s used to login
right ?

6

Re: IP logger for better security

I'm still having trouble in seeing the benefit.

If someone logs in from home, then the library, then an internet cafe, then a hot spot, it doesn't tell you anything other than they move around, and own a laptop.

7

Re: IP logger for better security

the benefit, is when you are watching an ip that's suspicious (let's say the owner of a rival dating site ;-)
, and he logs in at a different account, you can see the history?

8

Re: IP logger for better security

How could you determine if a rival logged in?

I've had fake profiles registered, but only once have I had one point to another adult site.

If you have this problem, I would like to know more about it.

9

Re: IP logger for better security

I kind of agree with fatlizard but then again maybe I don't get the point. If you have competitors logging in to your site and joining, how does that benefit your competitor unless they are trying to steal members.  As far as IP goes, any competitor worth their salt knows their way around that, if they don't, I wouldn't consider them much of a competitor but more like a desperate or inept webmaster trying to find solutions in all the wrong places.

p.s. not sure who your host is, but most server logs will tell you that info as well.

Last edited by db3204 (2010-06-27 14:20:29)

10

Re: IP logger for better security

i know godyn wanted to be nice to us but i don't get this entire thing... there are IP features in CP i don't think anyone would need more to run the site pretty safely....

Last edited by doc (2010-06-27 14:27:58)

11

Re: IP logger for better security

Another consideration is that many Ips are not static. My internet service provider like most has a big range of IP numbers. When I log into a website at 9am, the IP number is different to that when I log in at 3pm. Many websites also do not have static IPs. Checking IPs is useful for checking that someone who claims to be in the US but might actually be in the Congo, but not very useful for much else.

12

Re: IP logger for better security

Hi Dragon,
Here it stays the same for years. We have cable.
I know a rival site has this feature (because that's how he knew I logged in with a friends account :-D he tracked my cookies incombination with IP)
So it would be handy if we had more features on this.

It's not always about stealing members.
Sometimes they come to see what's cooking. How well the site is running and if it's a competitor for their (big $$$) site (mine is free :-D )
I know I'm in the shooting range of these guys. Porn maffia, you know ;-)

13

Re: IP logger for better security

I tried this in the includes/lib/account_login.php file, but it didn't work.
Can anybody give me a clue where to post this function?


// IP logger
// ----------------------------------------------

$id = isset($_GET['id'])   ? trim($_GET['id'])   : 0; // member id
$dt = new DateTime();


// define log file, set to chmod 777
$file = "iplog.txt";
// get ip address
$addr = $_SERVER['REMOTE_ADDR'];
// open file and append
$openfile = fopen($file, "a");
// write IP-address
fputs($openfile, "$dt,$id,$addr<br>\n");
fclose($openfile);

14

Re: IP logger for better security

any help ?

15

Re: IP logger for better security

Hi, try to put it at index.php or at /includes/lib.php

www.vldMagic.com - first choice customizations help desk
www.vldCrowd.com - vldPersonals admins community

16

Re: IP logger for better security

ow, I get blank page when i put in lib.php :-/

17

Re: IP logger for better security

try with username instead of id

$id = $SESSION->conf['username'];
$dt = new DateTime();

18

Re: IP logger for better security

probably i'm placing it in the wrong place, where should i put the code?

19

Re: IP logger for better security

Do you want to record a single member ID/single IP, or record every login?

I can give you logging of every successful login into new database table (member, IP, login date/time)

Last edited by fatlizard (2010-07-03 13:13:29)