In File oddsnsod.htms
....
<META NAME="Date" CONTENT="2005-11-27" SCHEME="Year-Month-Day">
<link rel="stylesheet"
href="http://www.pearblossomhouse.com/mypages.css" type="text/css">
<?php
include '/home/pearblocom/public_html/php_scripts/log.php';
?>
<script language="JavaScript" TYPE="text/javascript">
<!--
function MM_swapImgRestore() { //v3.0
....
In log.php
...
<?php
function iif($expression, $returntrue, $returnfalse = '') {
return ($expression ? $returntrue : $returnfalse);
}
// 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 = sprintf('/home/username/public_html/logs/logs%d.txt',date('m'));
// Open the log file in "Append" mode
if (!$handle = fopen($logfile, 'ab')) {
die("Failed to open log file");
}
// Write $logline to our logfile.
if (fwrite($handle, $logline) === FALSE) {
die("Failed to write to log file");
}
//close it all up
fclose($handle);
?>
....
So could I call log.php from the end of the file with better success?
Sean wrote:
It's impossible to know where you are going wrong unless you post up
some code.
All php scripts are executed at server time all the html stuff is
displayed on the client; so it's not possible to delay script
execution until the images are displayed.