Hello there and thanks for looking I seem to be having some issues with the following code, I’m getting a error message when I hit submit from my HTML site I was wondering if anyone can help me figure out what this issue is.
I think it deals with the PHP code itself and not my HTML site, also the email get’s sent out with no issues everything looks good I just receive this error message on the HTML site when it’s finished.
ERROR MESSAGE - array(2) { [0]=> string(11) "mdanie000 " [1]=> bool(false) } can’t open file
<?php $headers = "MIME-Version: 1.0" . "\r\n"; $headers = "Content-type: text/html; charset=iso-8859-1" . "\r\n"; $headers = "From: [email protected]" . "\r\n"; $errormessage = "0" ; $file = fopen("//IPADDRESS/mcc_landing$/veriflauncher/Central/Detroit_Checklist/tempdata.txt", "r"); $data = array(); while (!feof($file)) { $data[] = fgets($file); } fclose($file); $Name = ($data[0]); var_dump($data); $mailto = "[email protected]" ; $Date = ($_POST[Date]); $CMCS = ($_POST[CMCS]); $CMCF = ($_POST[CMCF]); mail($mailto, "'Detroit Verification Checklist.'" , " 'Emp Name: ' $Name 'Ver Date: ' $Date\n \n **HUB Count Section** \n CMC Schedules: ' $CMCS\n CMC Verifications: ' $CMCF\n"); $mydir = "Detroit_Checklist/"; $myFile = "$mydir" . "$Date.txt"; $fh = fopen($myFile, 'w') or die("can't open file"); $strdata = "Detroit Verification Checklist\n"; fwrite($fh, "$strdata"); $strdata = "$Name"; fwrite($fh, "Emp Name: $strdata"); $strdata = "$Date" . "\n"; fwrite($fh, "Ver Date: $strdata"); $strdata = "$CMCS" . "\n"; fwrite($fh, "CMC Schedules: $strdata"); $strdata = "$CMCF" . "\n"; fwrite($fh, "CMC Verifications: $strdata"); fclose($fh); header( "refresh:0;url=http://IPADRESS/mcc_landing/home.html" ); ?>Thank you!!!