//Heres my quick usage example if (isset($_POST['submit'])) { $errorcatcher .= formcheck($postdata,"Name",30,"A","REQUIRE"); $errorcatcher .= formcheck($postdata,"Email",50,"EMAIL","REQUIRE"); $errorcatcher .= formcheck($postdata,"Website",100,"WEBSITE","NA"); if ($errorcatcher == "") { //if empty then no errors //SUCCESS } else { //at least one error was found. lets print them. echo $errorcatcher; } } if (isset($errorcatcher) || $_POST['submit'] == "") { //Display the form }