escape($id) . "' LIMIT 1"; $d->select($query); if($o = $d->fetch()) { $textid = $o->$result; if($counter) { $mysqlid = $o->Id; $query = "UPDATE vega_$table SET $counter=$counter+1 WHERE Id=$mysqlid"; $d->exec($query); } } } if($textid) { $path = "$FILES_DIR/$textid$suffix.$ext"; if(file_exists($path)) { $size = filesize($path); header("Content-Transfer-Encoding: binary"); header("Content-Type: $ctype"); header("Content-Disposition: attachment; filename=\"" . addslashes("$prefix$id") . ".$ext\""); header("Content-Length: $size"); readfile($path); } } ?>