OVERVIEW | SETUP | USER GUIDE | DOWNLOAD | TODO | NEWS | FAQ | FORUM | MAILING LIST | SUPPORT


FORUM  

Goto Thread: PreviousNext
Goto: Forum ListMessage ListNew TopicSearchLog In
$_SERVER or getenv(); replacement
Posted by: duncane (---.turboadsl.nordnet.fr)
Date: May 27, 2006 08:29AM

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 tongue sticking out smiley

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.



Sorry, only registered users may post in this forum.

Contact