Suche auf lima-city
-
in: PHP-Download-Script
geschrieben von killers4hell
Ich w?rde das so machen:
$befehl = "SELECT `url`, `anzahl` FROM `downloads` WHERE `id`='".$id."' LIMIT 1";
$antwort = mysql_db_query($hostname,$befehl,$verbindung);
if(!$antwort) { die("Ung?ltige ID!"); }
list($url, $anzahl) = mysql_fetch_row($antwort);
if(!file_exists($url)) { die("Die angeforderte Datei konnte nicht gefunden werden.<br> Wenn sie einem g?ltigen Link gefolgt sind, informieren sie bitte den Administrator."); }
$befehl = "UPDATE `downloads` SET `anzahl`='".($anzahl+1)."' WHERE `id`='".$id."' LIMIT 1";
$antwort = mysql_db_query($hostname,$befehl,$verbindung);
header("Location: ".$url);