| | |||||
| ||||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| Senior Member Join Date: Jul 2004
Posts: 1,383
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | Record an IP address? Is there any way I can record an IP address every time it visits my site and have it log it? Like I wanted to monitor one IP address, and everytime it came on have it record a log of "[Name] visited on May 8, 2006 at 12:06pm CST", and then for everytime they visit, it just keeps adding to the list? Thank you in advance, Andy |
| |
| | #2 (permalink) |
| NamePros Regular Join Date: Oct 2005 Location: Portugal
Posts: 800
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | something like this? Code: <?php
$resource = fopen("log.txt","a");
fwrite($resource,date("Y"."/"."m"."/"."d h:i:s")." - visited - $_SERVER[REMOTE_ADDR]\n");
fclose($resource);
?> date server time remote ip 2005/10/13 11:50:20 - visited - 193.136.77.119 this is the basic, it records to a text file
__________________ Joćo Fernandes Silva
Last edited by JFS; 05-08-2006 at 09:08 AM.
|
| |
| | #3 (permalink) |
| NamePros Member Join Date: May 2006
Posts: 43
![]() | Hi, By default exoops hasn't built-in this feature. But exoops has the code that stores the user ip. Each message of newbb has ip recorded only visible to moderators, each broken file report, broken file download has this feature. Look at mydownloads, mylinks, newbb modules. The store of IP is to help moderators, not used to geoip. Thanks, |
| |
| | #5 (permalink) |
| NamePros Member Join Date: Apr 2006 Location: Central PA
Posts: 101
![]() | Code: <?php
$visitor = $_SERVER[REMOTE_ADDR];
$ip = 'PERSONS IP ADDRESS';
if($ip == $visitor)
{
$resource = fopen("log.txt","a");
fwrite($resource,date("Y"."/"."m"."/"."d h:i:s")." - visited - $_SERVER[REMOTE_ADDR]\n");
fclose($resource);
}
?> |
| |
| | #6 (permalink) |
| Senior Member Join Date: Mar 2005
Posts: 4,948
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | PHP Code: |
| |
| | #7 (permalink) |
| Senior Member Join Date: Jul 2005 Location: NJ
Posts: 1,219
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | yeah secondversions is probably the best bet. i just simplified it a lil, incase u dont need those other vars he had in the first line. PHP Code:
__________________ Hacksar.com - Your source for random computer tips and tricks! MySiteMemberships.com - Keep track of your site registration information! Like my post? Rep is appreciated! |
| |
| | #8 (permalink) | ||||
| NamePros Member Join Date: Apr 2006 Location: Central PA
Posts: 101
![]() |
-thats the exact same thing I posted above SV's post. | ||||
| |