";āexit;ā}ā$urlā=āurldecode($QUERY_STRING);āifā(!āfile_exists($COUNT_FILE))āerror("Can'tāfindāfile,ācheckā'\$COUNT_FILE'āvar...");āifā((!ā$url)ā||ā(!āpreg_match("/http:/",ā$url)))āerrorā("Invalidāurl,āyouāchouldāaddāurlāex:āhttps://$SERVER_NAME$PHP_SELF?https://www.ftls.org/");ā$file_arryā=āfile($COUNT_FILE);ā//orāerror("Canānotāopenā\$COUNT_FILE");āwhileā(list($key,ā$val)ā=āeach($file_arry))ā{āifā($valā!=ā"")ā{ālist($file_url,ā$nb)ā=āpreg_split("/\t|\n/",ā$val);āifā($file_urlā==ā$url)ā{ā$nb++;ā$file_arry[$key]ā=ā"$file_url\t$nb\n";ā$findā=ā1;ā}ā}ā}ā$fileā=ājoinā("",ā$file_arry);āifā(!ā$find)ā$fileā.=ā"$url\t1\n";ā$fpā=āfopen("$COUNT_FILE",ā"w");ā//orāerror("Canānotāopenā\$COUNT_FILE");āflock($fp,ā1);āfputs($fp,ā$file);āflock($fp,ā3);āfclose($fp);āheader("Location:ā$url");ā?>