When i first go to the page, without doing anything i receive this error below. I don't understand why because I'm checking to see if the submit button got clicked.
Notice: Undefined index: username in /Applications/XAMPP/xamppfiles/htdocs/kwame.php on line 3
<?
$user_name = $_POST['username'];
$submit = isset($_POST['submit']);
if($submit){
echo $user_name;
}
else {
echo 'leave';
}
?>
<html>
<head>
<title> My Php Exercises </title>
</head>
<body>
<FORM name='login' method='POST' action='kwame.php'>
<input type='text' name='username' >
<input type='submit' name='submit'>
</FORM>
</body>
</html>