/ Published in: PHP
                    
                                        
test
                
                            
                                Expand |
                                Embed | Plain Text
                            
                        
                        Copy this code and paste it in your HTML
<?php
isGyu();
MethodStandard();
Right('*');
$informazioni = CallFunction('mediateca', 'get', $_GET["id"]);
$prodotto = $informazioni->getAttr('prodotto');
// L'utente, ha acquistato questo prodotto?
$carrelliValidi = CallFunction('acquisti', 'list');
foreach($carrelliValidi as $v)
if($v->getAttr('stato') >= 4)
$validCart[] = "carrelloId = '" . FetchObject(Database()->query("SELECT * FROM `carrelli` WHERE acquistoId = '".$v->getAttr('id')."' LIMIT 1"), 0)->getAttr('id')."'";
$q = "SELECT * FROM `carrelliItem` WHERE prodottoId = '".$informazioni->getAttr('prodotto')."' AND (" . implode(' OR ', $validCart) . ") LIMIT 1";
$informazioni_2 = FetchObject(Database()->query($q), 0);
$filename = upload . $informazioni->getAttr('contenuto');
// browser must download file from server instead of cache
// force download dialog
// use the Content-Disposition header to supply a recommended filename and
// force the browser to display the save dialog.
header("Content-Disposition: attachment; filename=".$informazioni->getAttr('nome') . "." . $ext .";");
}
?>
Comments
 Subscribe to comments
                    Subscribe to comments
                
                