Posted by:
duncane (---.turboadsl.nordnet.fr)
After installing ezStats, i noticed that the stats where full of empty fields so i decided to take a look at the code and correct what should be
in write_logs.php
in order to have this script work in any case, you should do the following replacement :
$To = $PHP_SELF;
should be replaced by :
$To = $_SERVER["PHP_SELF"]; or $To = getenv ( "PHP_SELF" );
$REMOTE_HOST = @getHostByAddr($REMOTE_ADDR);
by :
$REMOTE_HOST = @getHostByAddr($_SERVER["REMOTE_ADDR"]);
$res = mysql_query("INSERT INTO $table (id, request, host, address, agent, date, referer, country, provider, os, wb) VALUES ('', '$To', '$REMOTE_HOST', '$REMOTE_ADDR', '$HTTP_USER_AGENT', '$logdate', '$HTTP_REFERER', '', '', '', '')");
by :
$res = mysql_query("INSERT INTO $table (id, request, host, address, agent, date, referer, country, provider, os, wb) VALUES ('', '$To', '$REMOTE_HOST', '".$_SERVER["REMOTE_ADDR"]."', '".$_SERVER["HTTP_USER_AGENT"]."', '$logdate', '".$_SERVER["HTTP_REFERER"]."', '', '', '', '')");
those modifications done, the script should work perfectly.