Hi,
I have a strange issue. I am creating a php file located at:
http://www.airsep.com/test/index.php4
This file will record user information and log it into a database. Here is the code:
$filename = "data.txt";
$ip = $_SERVER['REMOTE_ADDR'];
$useragent = $_SERVER['HTTP_USER_AGENT'];
$date = date("F j, Y, g:i a");
$fh = fopen($filename, "a") or die("Could not open file!");
$data = $ip . "|" . $useragent . "|" . $date . "\n";
fwrite($fh , $data) or die("Could not write file!");
fclose($fh);
The problem I am having is that if you visit the site, it will not write the information to the database, but if you visit the site and hit the refresh button, it works. Why is this? Can someone help me out?
Ryan