954,580 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Warning: Cannot modify header information

Hello,

I know this question was answered many times, and I looked at the answers but still can't find a solution.

I have an index file that includes a contact form.

The contact form action is itself, and if the form succeeds it should redirect to index.php?content=thankyou

Althought the form is being sent successfuly, it does not redirect to index.php?content=thankyou, it tries to go again to itself: index.php?content=contact and I get the "cannot modify header..." error.

I've added ob_start, ob_flush, I checked for spaces after php codes, or anywhere else, nothing helps.

I am attaching the index, contact and the form class files.

The problem might be in the index file line: 56, or on the fgcontactform file line: 143.

I am losing hair here, please, can someone help?

Attachments contact.inc_.php (2.58KB) index.php (2.39KB) fgcontactform.php (15.24KB)
cgull
Light Poster
39 posts since Dec 2009
Reputation Points: 24
Solved Threads: 5
 

I noticed this

$formproc->RedirectToURL("index.php?content=thankyou");

and some HTML before it (DOCTYPE, html tags, maybe some more).
That might be the problem.

Buppy
Junior Poster in Training
86 posts since Nov 2010
Reputation Points: 12
Solved Threads: 2
 

Hi Buppy,

You are a STAR !!!

I moved the code before the DOCTYPE and now my hair starts growing again :)

THANK YOU !

cgull
Light Poster
39 posts since Dec 2009
Reputation Points: 24
Solved Threads: 5
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: