I get an error which is driving me mad.
I am trying to redirect to thankyou page from a contact form .
The details will be stored in my database but instead redirection I receive:

Warning: Cannot modify header information - headers already sent by (output started at C:\Program Files\Apache Group\Apache2\test\dabisolutions\site\contact_us.php:14) in C:\Program Files\Apache Group\Apache2\test\dabisolutions\site\contact_form1.php on line 55

my code for redirection is:

$insertGoTo = "thankyou.html";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s",$insertGoTo));

on the 14 line in contact_us.php I've got:
<img id="logo1" src="slices/logo.gif" alt="Dabi Solutions - Online Marketing"> AND

on the line 55 on the contact_form1 I've got:
header(sprintf("Location: %s",$insertGoTo));

The contact_form1.php is included in contact_us.php

Please anyone can help me?
Thank you.