Mijn excuus!
Dit is WMWinkel's eigen systeem!!
Sorry voor alle verwarring, maar ik raakte in de war met een andere webshop van me die daar wel op
[Php]
<?php
// FILE: uit db ophalen
$sql = mysql_query("SELECT * FROM orders where id='".$_GET['id']."' AND randkey='".$_GET['randkey']."' AND user = '".$_SESSION[ 'login']."'");
while($show = mysql_fetch_object($sql)) {
$naam = $show->product;
$adownloads = $show->adownloads;
$file = $show->download;
}
function getFile($sLocation, $sName)
{
// Kijken als de file bestaat
if(!file_exists($sLocation)
strstr($sLocation, ''))
{
echo "<script>alert('Dit bestand bestaat niet, mail de beheerder');</script>";
}
else
{
header ('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header ('Content-Description: File Transfer');
header ('Content-Type: application/octet-stream');
header ('Content-Length: ' . filesize($sLocation));
header ('Content-Disposition: attachment; filename=' . basename($sName));
readfile($sLocation);
}
}
$sDir = '';
if(isset($file))
{
$sFile = trim($file);
if(!empty($sFile))
{
getFile($sDir.$sFile, $sFile);
$newdownload = $adownloads - 1;
mysql_query("UPDATE orders SET adownloads='".$newdownload."' where id='".$_GET['id']."' AND randkey='".$_GET['randkey']."' AND user = '".$_SESSION[ 'login']."'");
}
}
?>[/code]