Ive been having problems with when using header() and session() on the same page. I am actually trying to create a download page that checks if a certain session is registered before bringing up the save as dialogue box via header. The script looks something like this -
PHP Code:
<?php
session_save_path('../../../my_sessns');
session_start();
if($_SESSION['cur_usr']){
//get $_get variable and declare some variables
header("Pragma: no-cache");
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Cache-Control: no-cache, must-revalidate, post-check=0, pre-check=0");
header("Content-type: $mime");
header("Content-Length: $filesize");
header("Accept-Ranges: bytes");
header("Content-Disposition: attachment; filename=\"$file\"");
header("Content-Transfer-Encoding: binary");
set_time_limit(0);
readfile("../../../files/$dir/$file");
exit;
}
else{
include_once '../includes/register.php';
}
?>
The script seem to work well on firefox and opera (9) but doesnt on IE7. Any ideas what could be wrong?