Bitrix Site Manager

CHit::GetByID

CDBResult
CHit::GetByID(
 int hit_id
)

The method GetByID returns information on the specified user hit.

Parameters

Parameter Description
hit_id The hit ID.

Structure of the returned record

Array
(
    [ID] => the hit ID
    [SESSION_ID] => the session ID
    [DATE_HIT] => date and time of the hit
    [GUEST_ID] => the visitor ID
    [NEW_GUEST] => [Y|N] flag "new visitor" (Y)
    [USER_ID] => the ID of a user under which the visitor was authorised (at the time of hit or before)
    [USER_AUTH] => [Y|N] flag indicating the visitor was authorised at the time of hit
    [URL] => hit page
    [URL_404] => whether the error 404 occurred on the hit page
    [URL_FROM] => URL from which the visitor came 
    [IP] => the IP address of the visitor at the time of hit
    [METHOD] => the HTTP request method
    [COOKIES] => contents of visitor's Cookie at the time of hit
    [USER_AGENT] => the visitor's UserAgent at the time of hit
    [STOP_LIST_ID] => the ID of the stop list record for the visitor(if applicable)
    [COUNTRY_ID] => the country ID (two-character identifier) of the visitor at the time of hit (defined by the IP address)
    [COUNTRY_NAME] => name of the visitor country at the time of hit (defined by the IP address)
    [SITE_ID] => the site ID (two-character identifier)
    [LOGIN] => the user login under which the visitor was authorised (at the time of hit or before)
    [USER_NAME] => first and last names of a user under which the visitor was authorised (at the time of hit or before)
)

See Also

Example



<?
$hit_id = 1;
if ($rs = CHit::GetByID($hit_id))
{
    $ar = $rs->Fetch();
    // print the hit parameters
    echo "<pre>"; print_r($ar); echo "</pre>";
}
?>