include('phpbrowserdetect.php'); $mugabe = new browser(); $videopage = $_GET['video']; if (stripos ($videopage, "/")===FALSE && stripos ($videopage,"\\")===FALSE) { include ("videos/" . $videopage . ".php"); file_put_contents ("lastvisited.txt", $videopage); $tallyArray = file_get_contents("tally.txt"); $tallyArray = unserialize($tallyArray); if(isset($tallyArray[$videopage])) { $tallyArray[$videopage] = $tallyArray[$videopage] + 1; } else { $tallyArray[$videopage] = 0; } arsort($tallyArray); reset ($tallyArray); $mostPopular = key($tallyArray); file_put_contents ("mostpopular.txt", $mostPopular); $tallyArray = serialize ($tallyArray); file_put_contents ("tally.txt", $tallyArray); } ?>