$counterdir = "/var/www/vhosts/beardmouse.co.uk/httpdocs/downloads/"; $filelocation = "/var/www/vhosts/beardmouse.co.uk/httpdocs/files/"; $textfont = "Verdana,Arial"; //text font for the error msg //need to change to make sure that an argument has been passed... if (file_exists("$filelocation$get")) { header("location: /files/$get"); // download the file [download.php?get=name_of_file] $file = fopen("$counterdir$get$.txt","r+"); // download counter $count = fread($file, filesize("$counterdir/$get.txt")); fclose($file); $count += 1; $file = fopen("$counterdir/$get.txt","w+"); fputs($file, $count); fclose($file); } else echo ""; echo "