<?php
if($_POST[&#039;submit&#039;]){

// this strips out any unwanted html tags and turns it into a string
if (!isset($_POST[&#039;fname&#039;]) && $_POST[&#039;fname&#039;]!="")#_#_#_#_#_#_#_# New line
{
 $_POST[&#039;fname&#039;] = filter_var($_POST[&#039;fname&#039;], FILTER_SANITIZE_STRING); 
//if the text field is empty put the error in the array
if ($_POST[&#039;fname&#039;] == "") {
       $errors[] = "Please enter your first name";
    }
}
else 
{
$errors[] = "Please enter your first name"; #_#_#_#_#_#_#_# New line
}

Add a code snippet to your website: www.paste.org