Reading the "important" posts at the top of this PHP forum, I can tell that there is supposed to be a missing quote, or parentheses on line four or five, but I can't simply figure out where.

Some help is appreciated.

The error, I get is: Parse error: syntax error, unexpected T_STRING in C:\wamp\www\mydomain\logs.php on line 5

Code:
<?php
// Getting the information
$ipaddress = $_SERVER['REMOTE_ADDR'];
$page = "http\://{$_SERVER['HTTP_HOST']}{$_SERVER['PHP_SELF']}";
$page .= iif(!empty($_SERVER['QUERY_STRING']), '?($_SERVER['QUERY_STRING'])',"");
$referrer = $_SERVER['HTTP_REFERER'];
$datetime = mktime();
$useragent = $_SERVER['HTTP_USER_AGENT'];
$remotehost = @getHostByAddr($ipaddress);
// Create log line
$logline = $ipaddress . "|" . $referrer . "|" . $datetime . "|" . $useragent . "|" . $remotehost . "|" . $page . "\n";

// Write to log file:
$logfile = "c:/wamp/www/mydomain/logfile.txt";

// Open the log file in “Append” mode
if (!$handle = fopen($logfile, 'a+')) {
die("Failed to open log file");
}

// Write $logline to our logfile.
if (fwrite($handle, $logline) === FALSE) {
die("Failed to write to log file");
}

fclose($handle);
?>
Thanks in advance.