Inizio  >  Docs  >  Programming  >  PHP  >  PHP  
PHPPHP

Index

Basics

Adding properties to your file

Formatting A Cell

Output to the browser as a download.

<?php
$phpExcel = new PHPExcel();
$phpExcel->getActiveSheet()->setTitle("My Sheet");

$phpExcel->setActiveSheetIndex(0);
header("Content-Type: application/vnd.ms-excel");
header("Content-Disposition: attachment; filename=\"filename.xls\"");
header("Cache-Control: max-age=0");

$objWriter = PHPExcel_IOFactory::createWriter($phpExcel, "Excel5");
$objWriter->save("php://output");
exit;

Setup saprfc php

sudo aptitude install libstdc++2.10-glibc2.2
sudo ln -sf /usr/lib/libstdc++-3-libc6.2-2-2.10.0.so /usr/lib/libstdc++-libc6.1-1.so.2
cd sap_sdk/
unzip 50076444_4.ZIP
unzip 50076444_5.ZIP
unzip 50076444_6.ZIP
cd LINUX_32/
cd NUC/
../../SAPCAR -xvf RFC.SAR
sudo mkdir /usr/sap
sudo cp -av rfcsdk /usr/sap/

wget -vc prdownloads.sourceforge.net/saprfc/saprfc-1.4.1.tar.gz
tar xfvz saprfc-1.4.1.tar.gz
cd saprfc-1.4.1/
phpize
./configure
make
sudo make install
sudo vim /etc/php5/apache2/php.ini
extension=saprfc.so
sudo /etc/init.d/apache2 reload

 

 

gestire register_globals = off

http://www.elvisciotti.it/blog/archives/154

Per montare un’applicazione/cms/script che funziona solo con register_globals = on (che sconsiglio !),
invece di rinominare tutte le variabili:

soluzione per tutta la cartella
crea .htaccess e scrivici "php_flag register_globals On"

soluzione per i singoli script
foreach($_POST AS $key => $value) { ${$key} = $value; }
foreach($_GET AS $key => $value) { ${$key} = $value; }
//da fare anche con SESSION e COOKIE se sono usati

To top