=10?$iM:"0$iM"); $iD = $aTime['tm_mday']; $iD = ($iD>=10?$iD:"0$iD"); $iHH = $aTime['tm_hour']; $iHH = ($iHH>=10?$iHH:"0$iHH"); $iMM = $aTime['tm_min']; $iMM = ($iMM>=10?$iMM:"0$iMM"); $iSS = $aTime['tm_sec']; $iSS = ($iSS>=10?$iSS:"0$iSS"); $logTime = "$iY-$iM-$iD $iHH:$iMM:$iSS"; if (getenv('REMOTE_ADDR')) { $logAddr = getenv('REMOTE_ADDR'); } else { $logAddr = '[?addr]'; } if (gethostbyaddr(getenv('REMOTE_ADDR'))) { $logHost = gethostbyaddr(getenv('REMOTE_ADDR')); } else { $logHost = '[?host]'; } if (getenv('REMOTE_PORT')) { $logPort = getenv('REMOTE_PORT'); } else { $logPort = '[?port]'; } if (getenv('HTTP_USER_AGENT')) { $logAgent = getenv('HTTP_USER_AGENT'); } else { $logAgent = '[?agent]'; } if (getenv('REDIRECT_URL')) { $logRedirect = getenv('REDIRECT_URL'); } else { $logRedirect = '[?redir]'; } if (getenv('HTTP_REFERER')) { $logReferer = getenv('HTTP_REFERER'); } else { $logReferer = '[?ref]'; } if (getenv('REQUEST_URI')) { $logReq = getenv('REQUEST_URI'); } else { $logReq = '[?req]'; } if (getenv('QUERY_STRING')) { $logQueryStr = getenv('QUERY_STRING'); } else { $logQueryStr = '[?q]'; } if (getenv('HTTP_ACCEPT_LANGUAGE')) { $logLang = getenv('HTTP_ACCEPT_LANGUAGE'); } else { $logLang = '[?lang]'; } if ( isset( $_REQUEST['PHPSESSID'] ) ) { $logSess = @$_REQUEST["PHPSESSID"]; } else { $logSess = '[?sess]'; } $log_fp = fopen($log_file, 'a'); flock($log_fp, 2); fwrite($log_fp, "$logTime|$logAddr|$logHost|$logPort|$logSess|$logAgent|$logRedirect|$logReferer|$logReq|$logQueryStr|$logLang\n"); fclose($log_fp); ?>