if (file_exists("$filename")) { header("location: $filename"); $file = fopen("$filename.txt","r"); $count = fread($file, 100); $count++; fclose($file); $file = fopen("$filename.txt","w"); fwrite($file, $count, 100); fclose($file); $ip = $_SERVER['REMOTE_ADDR']; $file2 = fopen("stat.txt","a"); $line = "\n".$filename.";".date ("d.m.Y H:i").";".$ip; fwrite($file2, $line, 100); fclose($file2); } else { echo "