List

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.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);
?>