Undefined variable lines 13, 19, 26, and 33 shows up when I load the page, and I have no idea why. Thank you in advance for your help.
[php]
<?php if (($_SERVER['REQUEST_METHOD'] == 'POST') && (!empty($_POST['action']))): endif; //form submitted if (isset($_POST['myname'])) { $myname = $_POST['myname']; } if (isset($_POST['phone'])) {$phone = $_POST['phone']; } if (isset($_POST['email'])) {$email = $_POST['email']; } $formerrors = false; if ($myname ===''): $err_myname = "*Sorry, your name is a required field"; $formerrors = true; endif; //Input Field Empty if ($email ===''): $err_email = "*Sorry, your email is a required field"; $formerrors = true; endif; //Input Field Empty if ( !(preg_match('/^([0-9a-zA-Z]([-\.\w]*[0-9a-zA-Z])*@([0-9a-zA-Z][-\w]*[0-9a-zA-Z]\.)+[a-zA-Z]{2,9})$/', $email)) ): $err_patternmatch = "*Your email must be in the correct format"; $formerrors = true; endif; //Input Must Match Proper Format if ( !(preg_match('/[A-Za-z]+, [A-Za-z]+/', $myname))): $err_namematch = "*Your name must be in the format: Last, First"; $formerrors =true; endif; //Input Must Match Proper Format if (!($formerrors)): $to = "[email protected]"; $subject = "From $myname "; $message = "$myname has filled out the form."; $replyto = "From: $email \r\n". "Reply-To: [email protected] \r\n"; if (mail($to,$subject,$message)): $msg = "Thank you for filling out the form!"; else: $msg = "Problem sending message"; endif; // mail form data endif; // Check for For Errors ?> [/php]