Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

monitoring functions

Status
Not open for further replies.

sonun

IS-IT--Management
Dec 26, 2001
384
US
How do I get the IP/ DNS adress of every visitor to my site and also record the counts. Best would if everything will be timestamped to a log file.
I also see in mail programs like hotmail, the sender IP address is listed. Now lets say I set up mailing from my PHP page (not done that yet), how do I set it up so that, the IP and DNS appears with the mail to the target person even if the person has logged on through other computers, is it possible to list the entire route ???
I know just about this for now,
$_SERVER['REMOTE_ADDR']
but thats it.
Thanks.
 
This might be useful to you, even if they use a proxy the PHP script will still get the information:

if ($HTTP_SERVER_VARS["HTTP_X_FORWARDED_FOR"]!="") {

$IP = $HTTP_SERVER_VARS["HTTP_X_FORWARDED_FOR"];
$proxy = $HTTP_SERVER_VARS["REMOTE_ADDR"];
$host = @gethostbyaddr($HTTP_SERVER_VARS["HTTP_X_FORWARDED_FOR"]);

$origin="(proxy) HOST: " .$host . " IP: " . $IP;

}

else {

$IP = $HTTP_SERVER_VARS["REMOTE_ADDR"];
$host = @gethostbyaddr($HTTP_SERVER_VARS["REMOTE_ADDR"]);

$origin="HOST: " .$host . " IP: " . $IP;

}
 
Wow !! Thanks.
But will it loop and list the entire route. What I mean is, lets say, I ssh from one machine to another and from there to another and ........................... and finally
'mail -s &quot;test&quot; user < file1.
Will I be able to retrieve all the hop information ??.
Why I ask this is that recently I had ssh'd into a few machines and finally did sent a mail to myself (@hotmail.com) as somebody else and asked the tech support at hotmail that I want to know from where this came from and sure engouh they were able to trace through all the computers I had gone through until they reached me. Now, I also want to able to know till the last node when someone sends a mail to me, as I have a sendmail server myself !!
Thanks.

 
Also,
how do I list the FQDN instead of just the hostname. Is there a gethostfqdn as well ??
Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top