[Typo3-dev] Cannot modify header information - headers already sent
Pedro Barbosa
pbarbosa at inescporto.pt
Thu Nov 10 17:56:17 CET 2005
Hi!
I sign in to this list but i'm not sure if thats the right one, anyways...
I'm getting started in typo3 and i wanted to include php script.
Justo for fun(or not) i created a calculator in php and when i open the
website i get the following warning:
*Warning*: Cannot modify header information - headers already sent by
(output started at ..../scripts/calculadora.inc:41) in
*/var/www/html/sigtest/typo3_src-3.8.0/typo3/sysext/cms/tslib/class.tslib_fe.php*
on line *2612*
The script runs and works but i wanted to remove the warning.
Anyone can help me?
follows php script and inc used for typo3
class calculadora
{
function cria()
{
$url==$_SERVER['PHP_SELF'];
$soma= $this->calcula();
echo <<< EOF
<form method="POST" action=$url>
<input type="text" name="valor1" id="valor1" size="8" />
<p>
<input type="text" name="valor2" id="valor2" size="8" />
</p>
<input type="text" name="resultado" id="resultado" size="8"
disabled="false" value=$soma>
<input type="submit" value="CALCULA" />
</form>
EOF;
}
function calcula()
{
$val1=(int)$_POST["valor1"];
$val2=(int)$_POST["valor2"];
return $val1+$val2;
}
}
in my site template i have in setup:
config.includeLibrary = fileadmin/scripts/include.inc
# Default PAGE object:
page = PAGE
page.10 = PHP_SCRIPT
page.10 {
file= fileadmin/scripts/calc.inc
}
calc.inc has
$calc_object=new calculadora;
$contentBefore=$this->cObjGetSingle($conf["cObj"],$conf["cObj."]);
$content=$contentBefore.$calc_object->cria();
$content=$this->stdWrap($content,$conf["stdWrap."]);
More information about the TYPO3-dev
mailing list