Try: ca/tecreations/ViewFile.php
<?php
require_once $_SERVER['DOCUMENT_ROOT'] . "/tec_SiteRoot.php";
global $DOCROOT, $TEC_PREFIX_DIR;
global $referrer;
$referrer = "";
if (isset($_REQUEST['referrer']) && !empty($_REQUEST['referrer'])) {
$referrer = $_REQUEST['referrer'];
}
require_once $DOCROOT . $TEC_PREFIX_DIR . "demo_db.php";
$demo_db = new MySQL($demo_DB_HOST, $demo_DB_USER, $demo_DB_PASS, $demo_DB_NAME);
$projectJarPath = $DOCROOT . $TEC_PREFIX_DIR . "tec8_jars.jar";
$result = $demo_db->select("SELECT count FROM downloads WHERE abspath='$projectJarPath'");
if ($result['count'] == 1) {
$row = $result['rows'];
$total = (int)$row['count'] + 1;
$demo_db->issue("UPDATE downloads SET count='$total' WHERE abspath='$projectJarPath'");
}
header("Location: " . "/" . $referrrer);
?>