![]() |
[PHP]Cannot modify header information - headers already sent
Hi,
wenn ich folgenden PHP-Code hab:
Code:
Dann kommt beim aufruf:
header('Location: guestbook.php');
exit; Cannot modify header information - headers already sent by (...) Warum kann der die header nicht verändern? |
Re: [PHP]Cannot modify header information - headers already
Hi spider,
sobald einmal eine HTML-Ausgabe erfolgt ist, darf kein header-Aufruf mehr kommen, da sonst ja schon HTML-Header rausgeschickt wurden. Greetz alcaeus |
Re: [PHP]Cannot modify header information - headers already
Und was könnte ich sonst machen?
Ich möchte die Seite neu laden, damit man beim klick auf Aktuallisieren oder wenn man F5 drückt nicht nochmal ein Eintrag in die DB geschrieben wird. |
Re: [PHP]Cannot modify header information - headers already
Hi Spider,
du musst den header-Aufruf einfach ganz oben in die HTML-Datei schreiben:
Code:
Greetz
<?php
if ($DeineAbfrageVariable == 1) { header('Location: guestbook.php'); exit; } ?> <html> <head> ... alcaeus |
Re: [PHP]Cannot modify header information - headers already
Hi,
thx. So gings ;). *MFG* |
Re: [PHP]Cannot modify header information - headers already
alternativ kann man auch mit echo einen reload ausgeben (JavaScript).
allerdings könnte der user js ausgeschaltet haben, daher (wei du schon biem header gemacht hast) immer ein exit anhängen air |
Alle Zeitangaben in WEZ +1. Es ist jetzt 20:03 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz