function addTask($addData){
if(isset($_POST["name"])):
$_POST["name"] = trim($_POST["name"]);
$_POST["name"] = strip_tags($_POST["name"]);
$_POST["name"] = htmlspecialchars($_POST["name"],ENT_QUOTES);
$_POST["name"] = stripslashes($_POST["name"]);
endif;
if(isset($_POST["task"])):
$_POST["task"] = trim($_POST["task"]);
$_POST["task"] = strip_tags($_POST["task"]);
$_POST["task"] = htmlspecialchars($_POST["task"],ENT_QUOTES);
$_POST["task"] = stripslashes($_POST["task"]);
endif;
$db = new PDO("mysql:dbname=test; host=localhost", "root", "root");
$sql = "INSERT INTO tasks (name, task) VALUES (:name, :task)";
$statement = $db->prepare($sql);
$statement->execute($addData);
}