Very simple problem but got me beat.
I am trying to capture and print on the screen the IP address that is looking at my webpage.
After a lot of research I believe I have the data but cannot print it in PHP ( in an ASP WRITE RESPONSE type manner)
Here is my test page. What am I doing wrong ?!
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Untitled</title>
</head>
<body>
<?php
$page ='Test page';
$ipaddress = $_SERVER['REMOTE_ADDR'];
$date = date ("M dS H:i:s");
$message = "$page _ $ipaddress _ $date\n";
$File = "track.txt";
$Open = fopen($File, "a+");
if ($Open){
fwrite($Open, "$message");
fclose ($Open);
}
<br>
print this is a print on the screen statement; <br>
print $message; <br>
<br>
Some test data to see if it can be displayed.
$result = "OK";
$update = "Yes";
$updateid = "90094";
echo "result=".$result."\n";
echo "update=".$update."\n";
echo "updateid=".$updateid."\n";
?>
</body>
</html>