Mailinglisten-Archive |
Hallo,
ich beschaeftige mich gerade mit der "Cookies und Sessions -
Programmierung".
Wenn ich das Script im Browser aufrufe, erhalte ich Fehlermeldungen.
Kann mir bitte einer weiterhelfen?
gruesse klaus millich
Das php-script:
<!doctype html public "-//W3C//DTD HTML 4.0 //EN">
<html><head><title>Cookies</title></head>
<body>
<?php
$action = $_SERVER['PHP_SELF'];
if (!empty($_POST['face']) && !empty($_POST['size']))
{
$expires = time() + 300;
setcookie('face', $_POST['face'], $expires);
setcookie('size', $_POST['size'], $expires);
}
if (!empty($_COOKIE['face']))
{
$face = $_COOKIE['face'];
$size = $_COOKIE['size'];
}
else
{
$face = 'Courier New';
$size = 3;
}
?>
Ihre Auswahl fuer Schriftart und -groesse:<br>
<form action="<?=$action?>" method="post">
### DAS FORMULAR HAB ICH AUS PLATZGRUENDEN WEGGELASSEN ###
</form><hr/>
<font face="<?=$face?>" size="<?=$size?>">
Dies ist ein Mustertext, der im gewaehlten Font angezeigt wird
</font></body></html>
daraufhin erhalte ich folgende Meldung im Browser:
Warning: Cannot modify header information - headers already sent
by (output started
at /home/skyfly/htdocs/htlager/learn/php/php_1/test/cookiestandard.php:7) in /home/skyfly/htdocs/htlager/learn/php/php_1/test/cookiestandard.php on line 12
Warning: Cannot modify header information - headers already sent
by (output started
at /home/skyfly/htdocs/htlager/learn/php/php_1/test/cookiestandard.php:7) in /home/skyfly/htdocs/htlager/learn/php/php_1/test/cookiestandard.php on line 13
php::bar PHP Wiki - Listenarchive