September 05, 2008, 10:39:54 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Check your Page Rank, Backlinks, or Link Popularity in our tools section.
 
  Home   Forum   Help Search Directory Calendar Login Register    RSS 2.0 feedAtom feed


News
Check your Page Rank, Backlinks, or Link Popularity in our tools section.
Pages: [1]
  Print  
Author Topic:

Can I record an IP address ?

 (Read 1125 times)
0 Members and 1 Guest are viewing this topic.
sintex
Jr. Member
**

Points: 7
Offline Offline

Posts: 96


« on: June 12, 2006, 12:56:01 »

Is there any way I can record an IP address every time it visits my site? I see some websites what display your ip address when you are accessing specifica pages. Is possible to do a simple program to log this IP address in a file ?

Logged


chris3471
Full Member
***

Points: 3
Offline Offline

Posts: 187


WWW
« Reply #1 on: June 12, 2006, 13:46:56 »

Use this to get the ip.

$_SERVER['REMOTE_ADDR'];
Logged

TheGodFather
Administrator
Hero Member
*****

Points: 202
Offline Offline

Posts: 2570



WWW
« Reply #2 on: June 12, 2006, 13:49:18 »

What script language do you use on server side ? Php ? if Yes then is quite simple:
Code:
$fd = fopen("visits.log","a");
  fwrite($fd,date()." -  ".$_SERVER[REMOTE_ADDR]."\n");
fclose($fd);

Regards
Logged

mtorregiani
Jr. Member
**

Points: 0
Offline Offline

Posts: 26



WWW
« Reply #3 on: November 08, 2006, 00:09:38 »

If you don't use PHP, is there any other easier alternative?
Logged

TheGodFather
Administrator
Hero Member
*****

Points: 202
Offline Offline

Posts: 2570



WWW
« Reply #4 on: November 08, 2006, 00:19:56 »

Just read the apache log if you have static html ! In rest I think all scripting languages have some variables for http server environment !

Regards
Logged

cyxic
Jr. Member
**

Points: 0
Offline Offline

Posts: 22



WWW
« Reply #5 on: November 09, 2006, 05:10:18 »

Its possible in all scripting languages.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.4 | SMF © 2006, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks

TinyPortal v0.9.7 © Bloc
Valid XHTML 1.0! Valid CSS!