&Acirc;&nbsp;<?php
if($_POST[&#039;submit&#039;]){
&Acirc;&nbsp;
// 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
{
&Acirc;&nbsp;$_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;] == "") {
&Acirc;&nbsp; &Acirc;&nbsp; &Acirc;&nbsp; &Acirc;&nbsp;$errors[] = "Please enter your first name";
&Acirc;&nbsp; &Acirc;&nbsp; }
}
else 
{
$errors[] = "Please enter your first name"; #_#_#_#_#_#_#_# New line
}
&Acirc;&nbsp;

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