Blank page.. why ?

May 9, 2014 at 12:32 PM
Edited May 9, 2014 at 12:37 PM
I have this stupid code (to try to read my file xlsx)
<head>
  <link href="style.css" rel="stylesheet" type="text/css">
 </head>
 
<?php

echo "<form action=\"index.php\" method=\"POST\" name=\"form-select-zona\">\n";
echo "<select name=\"zona\" onchange=\"submit()\">\n";
echo "<option value=\"\">Scegli una vista</option>\n";
echo "<option value=\"2\">Anelli Zona 1</option>\n";
echo "<option value=\"1\">Anelli Zona 2</option>\n";
echo "<option value=\"0\">Elenco Completo</option>\n";
echo "</select>\n";
echo "</form>";


if(isset($_POST) && $_POST['zona']) 
$zona = $_POST['zona'];

if ($zona == '2') {
    $text = " di Zona 1";
    }
if ($zona == '1') {
    $text = " di Zona 2";
    }

echo "Elenco Anelli".$text." in Lavorazione";

{
/*
 * PHP Excel - Read a simple 2007 XLSX Excel file
 */

/** Set default timezone (will throw a notice otherwise) */
date_default_timezone_set('Europe/Rome');

//$inputFileType = 'Excel5'; 
//$inputFileName = './sampleData/example1.xls'; 
//$sheetname = 'Data Sheet #3'; 

include 'Classes/PHPExcel.php';

$inputFileName = 'anelli.xlsx';


//  Read your Excel workbook
try {
    $inputFileType = PHPExcel_IOFactory::identify($inputFileName);
    $objReader = PHPExcel_IOFactory::createReader($inputFileType);
    $objPHPExcel = $objReader->load($inputFileName);
} catch (Exception $e) {
    die('Error loading file "' . pathinfo($inputFileName, PATHINFO_BASENAME) 
    . '": ' . $e->getMessage());
}

//  Get worksheet dimensions
$sheet = $objPHPExcel->getSheet(0);
$highestRow = $sheet->getHighestRow();
$highestColumn = $sheet->getHighestColumn();

// echo $lastRow = $objPHPExcel->getActiveSheet()->getHighestRow(); mi restituisce le righe

echo "<table>\n";
//  Loop through each row of the worksheet in turn
for ($row = 1; $row <= $highestRow; $row++) {



    echo "<tr>\n";
    //  Read a row of data into an array
    $rowData = $sheet->rangeToArray('A' . $row . ':' . $highestColumn . $row, NULL, TRUE, FALSE);
    
    //$rowData[0][1] contiene il campo zona
    //$rowData[0][0] contiene il campo nome anello
    
if ($rowData[0][0]<>'' and $rowData[0][1]<> $zona )    {  //stampa solo le righe con la prima colonna completata
    foreach($rowData[0] as $k=>$v)
        //echo "Row: ".$row."- Col: ".($k+1)." = ".$v."<br />";
        echo "<td>".$v."</td>";
    echo "</tr>\n";
}
}
echo "</table>";
}

?>
but, at home (Mac OS 10.9) work with no problem
At work (PHP Version 5.2.6 over Windows) the page is blank

why ?
Oct 28, 2014 at 2:01 AM
Same here, but it works on Linux?