hello,
I recently added the following code to my mainpage:
--- start code ---
if (!$countrycode) {
$output = gethostbyaddr(getenv(REMOTE_ADDR));
$checkhost = explode(".",$output);
$checklength = count($checkhost);
if ($checklength>1) {
$cc = $checkhost[count($checkhost)-1];
}
setcookie("countrycode", $cc, time() + 604800);
}
--- stop code ---
the purpose is to store the country code of a visitor in a cookie, to use later on for targeted banner advertising
no problems, until a visitor told me his browser gave the following error:
(I removed the ip address by xxx)
--- start error ---
Warning: Unable to resolve xxx.xxx.xx.xxx in /top.php3 on line 8
Warning: Cannot add header information - headers already sent by (output started at /www/top.php3:8) in /www//top.php3 on line 14
--- stop error ---
I tested the page with some browser (NS 4.0, 4.7 and 6 - IE 5.5 - Opera 4.0) and no error...
the visitor uses IE 5 128bit under win 98
anybody an idea ???
many thanks - any help would be greatly appreciated !
Joachim