We have the latest TraceWatch installed on our domain and we want to track a number of external sites. Some of those sites are PHP4 - The purpose of RemoteLogRequest.php (at least from my observation) does not absolutely require PHP5 to do its job. At the very least, there should be a RemoteLogRequestPHP4.php file so that users can take advantage of the great php tracking facilitated by the remote connection on php4 sites.
Correct me if I'm wrong but I believe the only thing that needs to be modified in RemoteLogRequest is the use of DOMDocument / doc->load.. - Is there not a PHP4 equivalent (domxml_open_file maybe?)
Has anyone managed to get this kind of setup working?
I tried to take a shot at it but i'm getting this error:
- Code: Select all
Fatal error: Call to undefined method: domelement->get_elements_by_tag_name() in [.....site...path.....]/RemoteLogRequestPHP4.php on line 102
Here is what I tried:
- Code: Select all
$doc = domxml_open_file($address.'?'.$params);
if (!$doc) {
trigger_error( "TraceWatch is unable to call ".$address, E_USER_WARNING );
}
if( $cookie ) {
$rootElement = $doc->document_element();
$tmpscookie = $rootElement->get_elements_by_tag_name('scookie');
$scookie = $tmpscookie->item(0);
if( $scookie !== null ) {
if( $scookie->has_attribute( 'value' ) ) {
$scookie = $scookie->get_attribute( 'value' );
setcookie( $cookiePrefix.'_scookie', $scookie, 0, $cookieFolder, $cookieDomain );
}
}
$tmppcookie = $rootElement->get_elements_by_tag_name( 'pcookie' );
$pcookie = $tmppcookie->item(0);
if( $pcookie !== null ) {
if( $pcookie->has_attribute( 'value' ) ) {
$pcookie = $pcookie->get_attribute( 'value' );
setcookie( $cookiePrefix.'_pcookie', $pcookie, time()+86400*3650, $cookieFolder, $cookieDomain );
}
}
}
