Thank you for your feedback. I have never done any real coding from scratch in php. So, everything is a learning experience for me. I appreciate your help and patience. We are getting closer. I fixed permission issues that I believe were causing some of my problems. Including the error code is so helpful. I had zero chance to debug at all before. I do not get the error "Could not open file $filename," although I do have the code included (lines 117-121). The script is now reading and writing both $input and $output files, as it should. The page is redirecting as I want, but the emails are not being sent.
This is my only error now is
Warning: Undefined array key 132 in <URL path>310nobel_f22-time.php on line 134
line 134: fputs($fp,$names[$i]);