1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
| <?php
function fct_download($nom_fichier)
{
// infos du fichier
$fichier = "/Telechargements/Cours_Systemes_et_reseaux/$nom_fichier";
// téléchargement du fichier
header('Content-disposition: attachment; filename='.$nom_fichier);
header('Content-Type: application/pdf');
header('Content-Transfer-Encoding: base64\n');
header('Content-Length: '.filesize($fichier));
header('Pragma: no-cache');
header('Cache-Control:must-revalidate, post-check=0, pre-check=0');
header('Expires: 0'); readfile($fichier);
}
switch($_POST['Cours']){
case "systemes_exploitation":
header("Location: http://pc.fastoche.free.fr/Telechargements/Cours_Systemes_et_reseaux/Systemes_exploitation.pps");
break;
case "presentation_reseaux":
header("Location: http://pc.fastoche.free.fr/Telechargements/Cours_Systemes_et_reseaux/Presentation_des_Reseaux_source_profs_d_info_BTS.pps");
break;
case 'Reseau_Introduction': fct_download('Reseau_Introduction.pdf');
break;
}
?> |
Partager