Deze code werkt niet maar ik weet niet wat ik fout doe
Code:
<html>
<head><title></title></head>
<body>
<form method="POST">
<input type="username" id="username">
<input type="submit" id="Test" onclick="test();">
</form>
</body>
</html>
<?php
function test()
{
$name = $_POST['username'];
if($name=="")
{
echo "Er is niets ingevuld";
}
else
{
echo "er is iets ingevuld.";
}
}
?>