Thanks to enijar figured out the first error but now I see that it is not writing anything to my file. So again, not sure what's going on.
        function clean_string($string) {
          $bad = array("content-type","bcc:","to:","cc:","href");
          return str_replace($bad,"",$string);
        }
        $fp = fopen("demoFormData.txt", "a");
        $savestring = clean_string($name).", ".clean_string($company).", ".clean_string($email).", ".$model.", ".$os.", ".$comments."\n"."-----------------------------------\n";
        fwrite($fp, $savestring);
        fclose($fp);
        echo 'form saved';
and this is all of my relevant code including error checks:
if(isset($_POST["submit"])){
    function died($error) {
        // your error code can go here
            echo "We are very sorry, but there were error(s) found with the form you submitted. ";
            echo "These errors appear below.<br /><br />";
            echo $error."<br /><br />";
            echo "Please go back and fix these errors.<br /><br />";
            die();
        }
        if(!isset($_POST['name']) ||
            !isset($_POST['company']) ||
            !isset($_POST['email']) ||
            !isset($_POST['model']) ||
            !isset($_POST['OS']) ||
            !isset($_POST['comments'])) {
            died('We are sorry, but there appears to be a problem with the form you submitted.');       
        }
        $name = $_POST["name"];
        $company = $_POST["company"];
        $email = $_POST["email"];
        $model = $_POST["model"];
        $os = $_POST["OS"];
        $comments = $_POST["comments"];
        $error_message = "";
        $email_exp = '/^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/';
        if(!preg_match($email_exp, $email)){
            $error_message .= 'The Email Address you entered does not appear to be valid.<br />';
        }
        $string_exp = "/^[A-Za-z .'-]+$/";
        if(!preg_match($string_exp, $name)){
            $error_message .= 'The Name you entered does not appear to be valid.<br/>';
        }
        if(!preg_match($string_exp, $company)){
            $error_message .= 'The Company you entered does not appear to be valid.<br/>';
        }
        if(strlen($comments) < 2) {
            $error_message .= 'The Comments you entered do not appear to be valid.<br />';
        }
        if(strlen($error_message) > 0) {
            died($error_message);
        }
        function clean_string($string) {
          $bad = array("content-type","bcc:","to:","cc:","href");
          return str_replace($bad,"",$string);
        }
        $fp = fopen("demoFormData.txt", "a");
        $savestring = clean_string($name).", ".clean_string($company).", ".clean_string($email).", ".$model.", ".$os.", ".$comments."\n"."-----------------------------------\n";
        fwrite($fp, $savestring);
        fclose($fp);
        echo 'form saved';
    }
Pretty new to PHP but no stranger to reading and writing from files, so any help is much appreciated.
 
     
    