Dici che così non possa funzionare? Meglio se faccio una pagina che mi controlla lo stato dell'utente e mi rimanda a download2.php e lì richiamo il readfile??Codice PHP:<?php
include_once("../include/config.php");
include_once("../include/auth.lib.php");
list($status, $user) = auth_get_status();
function readfileheader($file) {
if($file) {
header("Expires: Mon, 12 Jul 1976 06:20:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header('Content-type: application/octet-stream');
header('Content-Disposition: attachment; filename="'.basename($file).'"');
readfile($file);
}
}
switch($status){
case AUTH_LOGGED:
$nomefile = $_GET['file'];
$string = './download/'.$nomefile;
readfileheader($string);
/*
header("Refresh: 1;URL=./download/$file");
*/
break;
case AUTH_NOT_LOGGED:
echo 'You must be logged in to do that';
header("Refresh: 3;URL=../memberslogin.php");
break;
}
?>

Rispondi quotando