Page 1 of 1

Appear User's ip address on last visit???

PostPosted: Sat Aug 12, 2006 10:10 pm
Author: febern
Hello!

I would like to know that how can i see/appear the user's ip address on last visit? because i think some of my users register themselves multiple times to get more and more trial days, and i would like if i could filter in these users, and compare there ip addresses.

So how can i do that i seee theirs last ip address on last visit time??

Re: Appear User's ip address on last visit???

PostPosted: Sat Aug 12, 2006 10:52 pm
Author: a_lunatic
I use this 1 on mine its simple but works great

[url=http]phpbbhacks[/url]

Re: Appear User's ip address on last visit???

PostPosted: Sun Aug 13, 2006 1:08 am
Author: febern
"a_lunatic";p="13595" wrote:I use this 1 on mine its simple but works great

[url=http]phpbbhacks[/url]



Thx for your help!

Re: Appear User's ip address on last visit???

PostPosted: Tue Aug 15, 2006 11:42 pm
Author: febern
Well, i just tested it and it doesn't work for me, i go error message <img>


1. i saved my page_header.php
2. the txt file says:

###################################################################
# Find:
###################################################################
else if ( $phpver > '4.0' )
{
if ( strstr($HTTP_SERVER_VARS['HTTP_ACCEPT_ENCODING'], 'gzip') )
{
if ( extension_loaded('zlib') )
{
$do_gzip_compress = TRUE;
ob_start();
ob_implicit_flush(0);

header('Content-Encoding: gzip');
}
}
}
}



Instead of it,i have this in my page header:

else if ( $phpver > '4.0' ) {
if ( strstr($accept_encoding, 'gzip') ) {
if (extension_loaded('zlib') ) {
$do_gzip_compress = TRUE;
ob_start();
ob_implicit_flush(0);
}
}
}
}



Well, as you see it's not the same but i tried to put this code after those lines:

//
// Username and IP Logging
//
$dt = date("j-F-Y H:i:s");
$fp = fopen("IPlog.txt", "a+");
$ip = $_SERVER['REMOTE_ADDR'];
$un = $userdata['username'];
$mg = "$dt $un From IP address $ipn";
fwrite($fp, "$mgrn");
// change the above line to fwrite($fp, "$mgnn"); for unix
// or leave as-is for Windows
fclose($fp);
//



I upload the edited file and i get this error:

Warning: fopen(IPlog.txt): failed to open stream: Permission denied in /home/********/www/mobil/includes/page_header.php on line 59

Warning: fwrite(): supplied argument is not a valid stream resource in /home/**********/www/mobil/includes/page_header.php on line 63

Warning: fclose(): supplied argument is not a valid stream resource in /home/**********/www/mobil/includes/page_header.php on line 66

Warning: Cannot modify header information - headers already sent by (output started at /home/*********/www/mobil/includes/page_header.php:59) in /home/********/www/mobil/includes/page_header.php on line 961

Warning: Cannot modify header information - headers already sent by (output started at /home/********/www/mobil/includes/page_header.php:59) in /home/*********/www/mobil/includes/page_header.php on line 963

Warning: Cannot modify header information - headers already sent by (output started at /home/**********/www/mobil/includes/page_header.php:59) in /home/************/www/mobil/includes/page_header.php on line 964

Re: Appear User's ip address on last visit???

PostPosted: Wed Aug 16, 2006 4:22 am
Author: a_lunatic
Did u create the txt file for it to write to & chmod it to 777 ?

also check this part & make sure it is setup right for what the server is running
Code: Select all
fwrite($fp, "$mgrn");// change the above line to fwrite($fp, "$mgnn"); for unix// or leave as-is for Windows


Also i changed the name of the txt file just in case some1 gets to it with the default name

Code: Select all
$fp = fopen("IPlog.txt", "a+");

Re: Appear User's ip address on last visit???

PostPosted: Wed Aug 16, 2006 5:56 am
Author: febern
Correct, thank you for your help it was mistake by me. <img>