Cannot modify header information

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
isabelle
Forum Newbie
Posts: 7
Joined: Mon Jan 17, 2005 2:12 pm

Cannot modify header information

Post by isabelle »

I am trying to solve a reload (duplication) problem with my form and I've been trying to redirect to a receipt page.

But I keep getting this error:

Warning: Cannot modify header information - headers already sent by (output started at db.inc:36) in example.8-4.php on line 26

I am not familiar with headers. What can I do to solve this problem?
Revan
Forum Commoner
Posts: 83
Joined: Fri Jul 02, 2004 12:37 am
Location: New Mexico, USA
Contact:

Post by Revan »

Remove any data being sent before the headers, this includes the most common error:

Code: Select all

<?php
That new-line before the PHP tag will cause the error.
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

* yawn *
User avatar
shiznatix
DevNet Master
Posts: 2745
Joined: Tue Dec 28, 2004 5:57 pm
Location: Tallinn, Estonia
Contact:

Post by shiznatix »

and if your truley lazy and dont read those

Code: Select all

ob_start();
on the 1st line of the script your running. but, as fyed would say "this is a bandaid way, dont do this" but it does work
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

shiznatix wrote:and if your truley lazy and dont read those

Code: Select all

ob_start();
on the 1st line of the script your running. but, as fyed would say "this is a bandaid way, dont do this" but it does work
Stop mentioning the bandaid ;) Unrecommended.

Just kidding but you know..
Post Reply