Toon posts:

[PHP] Header error

Pagina: 1
Acties:
  • 169 views sinds 30-01-2008

Verwijderd

Topicstarter
Hi

Ik heb een header functie op lijn 105:

header("Location: redirect.php?id=$cid");

maar hij geeft me dit:

Warning: Cannot add header information - headers already sent by (output started at /home/virtual/site5/fst/var/www/html/news/comment.php:1) in /home/virtual/site5/fst/var/www/html/news/comment.php on line 105

Hoe voorkom ik die error?

Verwijderd

Je mag niks echo-en voordat je redirect.

  • D2k
  • Registratie: Januari 2001
  • Laatst online: 31-08 10:19

D2k

Doet iets met Cloud (MS/IBM)


  • ACM
  • Registratie: Januari 2000
  • Niet online

ACM

Software Architect

Werkt hier

Dan is er al output naar de browser gestuurd.

Staat hardstikke groot in de php manual bij www.php.net/header toch :?

Oftewel kijk es op regel 1 want daar werd de output begonnen volgens je melding.

  • D2k
  • Registratie: Januari 2001
  • Laatst online: 31-08 10:19

D2k

<h1>
Remember that header() must be called before any actual output is sent, either by normal HTML tags, blank lines in a file, or from PHP. It is a very common error to read code with include(), or require(), functions, or another file access function, and have spaces or empty lines that are output before header() is called. The same problem exists when using a single PHP/HTML file.
</h1>

Doet iets met Cloud (MS/IBM)


Dit topic is gesloten.