add number of request to data array, also output the data array to a file in script.php