Witam.
Mam taki skrypt, który działa prawidłowo na jednym serwerze tzn. że sie nie wysypuje i przegladarka otwiera plik w Excelu. Z kolei na innym serwerze skrypt sie nie wysypuje a przegladarka (ta sama,IE), nie potrafi otworzyc pliku ani w zewnetrznym programie (Excel) ani wyswietlic czegokolwiek.
Komunikat, ze "nie moze pobrac. Zadana witryna jest niedostepna lub nie moze jej znalezc". Komunikat jest nie jest wyswietlany na stronie, ale w oknie takim jak przy pobieraniu pliku. Pole typ pliku jest puste.
No a na tym 1szym serwerze w polu jest ze to plik Excel i sie otwiera.
podejrzewam ze chodzi o wysylanie błędnego nagłówka. gdzie to mozna sprawdzic/zmienic 
A oto ten skrypt :
<?
//Written by Dan Zarrella. Some additional tweaks provided by JP Honeywell
//pear excel package has support for fonts and formulas etc.. more complicated
//this is good for quick table dumps (deliverables)
$result = mysql_query('select * from authtab', $linkID);
for ($i = 0; $i < $count; $i++){
}
$line = '';
foreach($row as $value){
if(!isset($value) || $value == \"\"){ $value = \"t\";
}else{
# important to escape any quotes to preserve them in the data.
# needed to encapsulate data in quotes because some data might be multi line.
# the good news is that numbers remain numbers in Excel even though quoted.
$value = '\"' . $value . '\"' . \"t\";
}
$line .= $value;
}
$data .= trim($line).\"n\"; }
# this line is needed because returns embedded in the data have \"r\"
# and this looks like a \"box character\" in Excel
# Nice to let someone know that the search came up empty.
# Otherwise only the column name headers will be output to Excel.
if ($data == \"\") {
$data = \"nno matching records foundn\";
}
# This line will stream the file to the user rather than spray it across the scr
en
header(\"Content-type: application/octet-stream\");
# replace excelfile.xls with whatever you want the filename to default to
header(\"Content-Disposition: attachment; filename=excelfile.xls\"); header(\"Pragma: no-cache\");
echo $header.\"n\".$data; ?>
Prosze o pomoc ekspertów.
ps. Próbowałem z ob_start() i ob_end_flush() - ale tez nie dziala
Ten post edytował bartu$ 13.02.2005, 17:26:12