try with this:
place this code in your php file..
$username = $HTTP_SERVER_VARS['REMOTE_USER'];
$fullHostname = gethostbyaddr($REMOTE_ADDR);
$ip_address =$HTTP_SERVER_VARS['REMOTE_ADDR'];
$fp = fopen ("client.txt", "a+");
fwrite( $fp, "Client Address:", 26);
fwrite( $fp, $ip_address, 26);
fwrite( $fp, $username, 26);
fwrite( $fp, "Computer $fullHostname \n", 36);
fclose( $fp );
--Shastry