Bonjour,
a la fin de mon script (qui fonctionne) le header ne fonctionne pas.
merci
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
31
32
33 <?php require_once 'Classes/PHPExcel/IOFactory.php'; include("db_connect.php"); $id = $_GET['id']; $file = $_GET['fichier']; $inFile = 'xlsx/'.$file.''; $objReader = PHPExcel_IOFactory::createReader('Excel2007'); $objPHPExcel = $objReader->load($inFile); $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'CSV'); $index = 0; foreach ($objPHPExcel->getWorksheetIterator() as $worksheet) { $objPHPExcel->setActiveSheetIndex($index); // write out each worksheet to it's name with CSV extension $outFile = str_replace(array("-"," "), "_", $worksheet->getTitle()) ."MVTS POUR LE 16-02.csv"; $objWriter->setSheetIndex($index); $objWriter->save('csv/'.$outFile); $index++; } header('Location: encours.php?id='.$id.''); exit; ?>
Partager