[php] Headers already sent

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

  • airwalker_nl
  • Registratie: December 2001
  • Laatst online: 29-10-2022
Ik vraag me al een tijd af hoe je van dit probleem af komt:
Warning: Cannot add header information - headers already sent by (output started at C:\www\Apache2\users\mls\index.php:16) in C:\www\Apache2\users\mls\shop\addCart.php on line 8
Dit heb ik nu:
code:
1
2
3
<?
Header("Location: /viewCart.php?UID=$UID");
?>

Iemand ideeen :?

Vruchtensap? Oh, je bedoelt Breezer Malt - Loesje


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

D2k

als dit alles is van je code is het gewoon goed

Doet iets met Cloud (MS/IBM)


  • El Martino
  • Registratie: December 2000
  • Laatst online: 04-08 10:37

El Martino

Zo niet, dan toch.

Als je dat op line 8 hebt staan, heb je er vast HTML boven staan. De headers moeten als eerste in je php file komen.

"To make a bad day worse, spend it wishing for the impossible", Calvin (Calvin & Hobbes)


  • mbravenboer
  • Registratie: Januari 2000
  • Laatst online: 06-11-2025
Dit was wel heel eenvoudig te vinden met de search:

[topic=368985/1/25]
[topic=339389/1/25]

Blog, Stratego/XT: Program Transformation, SDF: Syntax Definition, Nix: Software Deployment


  • Grum
  • Registratie: Juni 2001
  • Niet online
je mag geen 1 bit sturen (printen/echoen/als html includen) voor je de header's add

Let ook op een newline na het sluiten van de ?> tag in includes ed

  • airwalker_nl
  • Registratie: December 2001
  • Laatst online: 29-10-2022
ja bij die topics heb ik al gekeken maar daar word niet echt antwoord gegeven he!

Vruchtensap? Oh, je bedoelt Breezer Malt - Loesje


Verwijderd

Op donderdag 14 februari 2002 22:04 schreef D2k het volgende:
als dit alles is van je code is het gewoon goed
:)

maargoed, kijk eens in de buurt van C:\www\Apache2\users\mls\index.php:16 of je daar iets echo'd en zoja, NIET DOEN!

  • airwalker_nl
  • Registratie: December 2001
  • Laatst online: 29-10-2022
lol dit is me echo:
code:
1
<area shape="rect" coords="70,3,157,20" href="?page=tweedehands">

Vruchtensap? Oh, je bedoelt Breezer Malt - Loesje


  • mbravenboer
  • Registratie: Januari 2000
  • Laatst online: 06-11-2025
airwalker_nl: ja bij die topics heb ik al gekeken maar daar word niet echt antwoord gegeven he!
Dat lijkt mij sterk... Beide topics leggen precies uit wat er aan de hand is volgens mij :) .

Blog, Stratego/XT: Program Transformation, SDF: Syntax Definition, Nix: Software Deployment


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

D2k

http://www.php.net/manual/en/function.header.php
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.
Hoi,
deze thread gaat dicht :)
Dit is makkelijk te vinden via http://www.php.net/functienaam of http://www.php.net/manual/.
Mocht je alsnog tegen een probleem aanlopen ben je welkom om alsnog te posten hier in /14.

Doet iets met Cloud (MS/IBM)

Pagina: 1

Dit topic is gesloten.