Cita:
Iniciado por Kelpie
Código PHP:
<?
if (!$_GET[id]) {
echo "<br>Error, debes especificar una ID. <a href=\"index.php\">Volver al index</a>."; }
else {
$des=mysql_fetch_array(mysql_query("select * from contenido where id='$_GET[id]'"));
if (!$des) {
echo "<br>Error, no existe la descarga"; }
else {
mysql_query("update contenido set descargas=descargas+1 where id='$_GET[id]'");
header("Location=$des['url']); //<-- Aquí envíamos el archivo a descargar
}
}
?>
Yo le agregaria algun control al $_GET[id], seria sano para la seguridad de tus datos.
Saludos
Andres