Hi
Just changed my web hosting from Windows to Linux. Sorted out most problems, but trying to get my contact form to work.
Warning: Cannot modify header information - headers already sent by (output started at /home/probowlu/public_html/Contact.php:3) in /home/probowlu/public_html/Contact.php on line 75 Warning: Cannot modify header information - headers already sent by (output started at /home/probowlu/public_html/Contact.php:3) in /home/probowlu/public_html/Contact.php on line 77
below shows the related HEADER code Code ... <?php ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <?php $RootName = $SERVER['DOCUMENT_ROOT']; $FolderName = "formdata/"; $FullFolderName = $RootName . "/" . $FolderName; $dateYmd = date('Ymd'); $DateTime = date('Ymd') . " " . date('H:i'); $FileName = "Contact_data.txt"; // $FileName = $dateYmd . "Contact.txt"; $File_Name = "../" . $FolderName . "/" . $FileName; $FullFileName = $RootName . "/" . $File_Name; // +++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++ // Form Validation ... $cError = ""; $cTxtStr = trim($POST['cTxt']); $name_pat = "/[a-z .'-]+$/i"; if ( (!isset($POST['cFname'])) || ($POST['cFname'] == "") ) { $cError .= 'First Name must be given <br />'; } elseif ( !preg_match($name_pat,$POST['cFname']) ) { $cError .= 'First Name entered does not appear to be valid. <br />'; } if ( (!isset($POST['cSname'])) || ($POST['cSname'] == "") ) { $cError .= 'Surname must be given <br />'; } elseif ( !preg_match($name_pat,$_POST['cSname']) ) { $cError .= 'Surname entered does not appear to be valid. <br />'; } if ( (!isset($POST['cMail'])) || (trim($POST['cMail']) == "") ) { $cError .= "Email address must be given <br />"; } else { $mail = stripslashes($POST['cMail']); $mail_pat = "/[.0-9a-zA-Z-]+@([0-9a-zA-Z][0-9a-zA-Z-]+.)+[a-zA-Z]{2,6}$/i"; if ( !preg_match($mail_pat, $mail) ) { $cError .= "Email address is invalid. <br />"; } } if( strlen($cTxtStr) < 2 ) { $cError .= "Please type your message. <br />"; } if ( ($cError == "") OR ($cError == NULL) ) { $file_record = NULL; $file_record = $POST['cFname'] . " " . $POST['cSname'] . " " . "\r\n"; $file_record .= $POST['cMail'] . " " . "\r\n"; $file_record .= $POST['cTxt'] . " " . "\r\n"; $file_record .= " ...... ... " . $DateTime . " "; $file_record .= "\r\n"; $file_record .= "++++++++++++++++++++++++++++++++++++++" . "\r\n" . "\r\n"; // $FileToOpen = $FullFileName; $FileToOpen = $FolderName . $FileName; // echo ("About to open "); // echo ($FileToOpen); // echo (" ... "); $open_file = fopen($FileToOpen,"a+") or die("Cant open the file"); fwrite($open_file, $file_record); // write a record fclose($open_file); $cError = ""; // header("Location: www.probowluk.co.uk/Contact_Done.php"); // // Send the "301 Moved Permanently" status code first. header("HTTP/1.1 301 Moved Permanently"); //Redirect the browser ... header("location: http://www.probowluk.co.uk/Contact_Done.php"); exit(); } ELSE { $file_record = NULL; $file_record = $cError . " " . "\r\n"; $file_record .= " ...... ... " . $DateTime . " "; $file_record .= "\r\n"; $file_record .= "+++++++ ++++++ +++++++++ +++++++" . "\r\n" . "\r\n"; $FileToOpen = $FolderName . $FileName; $open_file = fopen($FileToOpen,"a+") or die("Cant open the file"); fwrite($open_file, $file_record); // write error report into the file fclose($open_file); $cError = NULL; // echo "++++ COMPLETED ! ++++"; } ?> <html xmlns="http://www.w3.org/1999/xhtml"> <head>