assign ("rand", $id); $smarty->assign ("author", $fetch['author']); $smarty->assign ("downloads", $fetch['downloads']); $smarty->assign ("size", $fetch['size']); $query="UPDATE `links` SET `downloads` = `downloads`+1 WHERE `id` = $id "; $row = mysql_query($query) or die(mysql_error()); $smarty->assign ("done", 1); }else{ header("location: index.php"); } if($template == "takemyfile"){ $smarty->display("$template/m.html"); }else{ $templatefile = 'm'; require 'display.php'; } ?>