if ($_POST['name'] != "" && $_POST['msg'] != ""){if (!preg_match("<>", $_POST['name']) && !preg_match("/^[-0-9A-Z_@\s]+$/i", $_POST['msg'])){echo "Contains invalid characters. Go back and fix it";}else{fputs($guestbook, $usermsg);fclose($guestbook);echo "Thx for using this guestbook.<br />";echo "Your Message has been submited.<br />";echo "Go <a href=\"http://localhost/guestbook.html\">here</a> to view your message";}} elseif($_POST['name'] == "" && $_POST['msg'] != ""){ echo "Please fill the name field";}elseif($_POST['name'] != "" && $_POST['msg'] == ""){echo "Please fill the message field";} else{echo "Please fill both of the fields and then submit";}?>