"; print_r(preg_grep("/\tpath=$url\t/", $Download)); exit; */ $path = "$_SERVER[DOCUMENT_ROOT]$_SERVER[PATH_INFO]"; if (is_file($path)) { $date = jst_time(time(), 7); if (count(array_values(preg_grep("/\tpath=$url\t/", $Download)))) { $i = 0; foreach ($Download as $line) { if(preg_match("/\tpath=$url\t/", $line)) { $file = dbfields($line); $cnt = $file[cnt] + 1; $Download[$i] = join("\t", array( "date=$date", "path=$_SERVER[PATH_INFO]", "cnt=$cnt" )); break; } $i++; } } else { $value = join("\t", array( "date=$date", "path=$_SERVER[PATH_INFO]", "cnt=1" )); $Download[] = $value; } data_save("$_SERVER[DOCUMENT_ROOT]/trycms/$System[datadir]/download.cgi", $Download); header("Location:$_SERVER[PATH_INFO]"); } else { errorpage(); } ?>