Right, this is odd. Help would be greatly appreciated.
I'm developing a website (http://174.132.115.253/~mohawks/signup.php) and a signup form. I have the same version of the website A) on my local machine and 😎 on some webspace. The link above is on the webspace.
On the webspace, reguardless what fields i fill in, when the page reloads after pressing submit I get the good old "Warning: Cannot modify header information - headers already sent by (output started at /home/mohawks/public_html/global_app.php:10) in /home/mohawks/public_html/signup.php on line 41" error message. I've made sure all header outputs are before the <HTML> tag and i've removed any stray spaces or returns in my editor.
Line 10 within global_app.php has my doctype
If I remove this line everything works great!, but of course i need my doctype and regardless where I put it the error persists.
--
Now, the localhost version of the same form also doesn't work but in a different way.
When the submit button is pressed firefox pauses to think for a second then offers this error message: "The connection was reset. The connection to the server was reset while the page was loading." (same in ie and chrome with less hopeful error msgs). This differs from the webspace version in that when I remove the doctype nothing changes. However I can remove a function call which does remove the error.
include 'include/functions/send_email.php'; <-- this i can edit out and it works fine
<?php
function send_email($f_name='',$l_name='',$to='',$from='',$subject='',$body='')
{
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "To: ".$f_name." ".$l_name." <".$to.">\r\n";
$headers .= "From: ".$from."\r\n";
if(mail($to, $subject, $body, $headers)) { //sends email (as per settings in php.ini) and returns true if successful
return true;
}
return false;
}
?>
So there you go.. crazy stuff! I'm pretty sure they are the same error but because the php versions on the localhost (v5.3.0) and webspace (v5.2.9) are different they are being handled in different ways.
Any thoughts anyone? or anymore info you need?
ta!