Oooh! Thanks both of you!
Apollo, I didn't realize that setcookie hade to be before
any output, what so ever. Sorry... But finally, now I understand.
social_experiment, great! Exactly was I was looking for. Now I guess I could put it as this as well:
Code: Select all
<?php
if (isset($_COOKIE['huru'])) {
$PrintOut = $_COOKIE['huru'];
}
else {
setcookie("huru", "Mamma", time()+3600, "/");
}
echo "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>
<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"
\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">
<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"sv\" lang=\"sv\">";
?>
<body>
<?php
echo $PrintOut;
?>
</body>
</html>
Is that better, or does ob_start(); and ob_end_flush(); work just as fine?
About:
Code: Select all
<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>
No, it's just an HTML (XHTML) page. Copied it from my old webdesign-teacher's site when I understood that you had to have the doctype declaration within php-tags. Should I remove the first line: xml...
Anyhow, thanks again. You saved me. I'm not so good at php yet, but if you want help with flash, maybe I could help.