<?php
include("../../mainfile.php");
$myts =& MyTextSanitizer::getInstance(); // MyTextSanitizer object
$lid = intval($HTTP_GET_VARS['lid']);
$xoopsDB->queryF("UPDATE ".$xoopsDB->prefix("mydownloads_downloads")." SET hits=hits+1 WHERE lid=$lid AND status>0");
$result = $xoopsDB->query("SELECT url FROM ".$xoopsDB->prefix("mydownloads_downloads")." WHERE lid=$lid AND status>0");
list($url) = $xoopsDB->fetchRow($result);
Header("Location: $url");
echo "<html><head><meta http-equiv=\"Refresh\" content=\"0; URL=".$myts->oopsHtmlSpecialChars($url)."\"></meta></head><body></body></html>";
exit();
?>