Dei,
Have a php log file, as follows:
[php]<?php
$deskIP = ‘70.184.11.168’;
$browser = $_SERVER[‘HTTP_USER_AGENT’];
$ipAddress = $_SERVER[‘REMOTE_ADDR’];
$target = “bot”;
$counterlog=‘counter.log’;
$ffptr=fopen($counterlog,‘r’) or die(“can’t open file”);
$count=fread($ffptr,1024);
fclose($ffptr);
$date = date(‘m/d/Y h:i:s a’, time());
$whole = $date.$ipAddress.$browser;
$log = ‘server.log’;
if((stripos($browser, $target) === false) AND ($ipAddress !== $deskIP)) {
$fptr = fopen($log, ‘a+’) or die(“can’t open file”);
fwrite($fptr,$whole);
fclose($fptr);
$count=$count+1;
$fileptr = fopen($counterlog,‘w’) or die(“can’t open file”);
fwrite($fileptr,$count);
fclose($fileptr);
}
?>[/php]
Tried everything to format $whole, yet it just has not worked… Thanx ahead…
Always,
Jacques P.
You are using the wrong slash. Use a backslash.
Line 11: $browser\n;
Kevin,
I already tried that, and I get
Parse error: syntax error, unexpected T_NS_SEPARATOR in /home/soft/public_html/democracyfirst.us/server1.inc on line 11… I know it should work, but it don’t…
Always,
Jacques P.
You are missing the double quotes at the start and end of that string