- stripslashes: documentation ( source)
- implode: documentation ( source)
- htmlspecialchars: documentation ( source)
- trim: documentation ( source)
<?php
$nameErr= $surnameErr = "";
$name= $surname = "";
$errors= "";
if ($_SERVER["REQUEST_METHOD"] == "POST")
{
if(empty($_POST['customer_name'])){
$errors[] = "Please provide with real human being name";
}
if(count($errors)>0) $errors = implode('<br />',$errors);
}
function test_input($data)
{
$data = trim($data);
$data = stripslashes($data);
$data = htmlspecialchars($data);
return $data;
}
?>