Hello guys,

I tried to make a simple login script that prints "Welcome to duty admin" if the username that the user typed is "admin". Otherwise, the message would be "Unauthorized". Nonetheless, I can't figure out why it gives me an error when I first run the script.

This is the code:

HTML Code:
<title>A BASIC HTML FORM</title>
	$user = $_POST['Username'];
	if ($user == "admin") {
		print ("Welcome to duty admin");
	else {
		print("You are not allowed here");

<FORM NAME ="form1" METHOD ="Post" ACTION = "basicForm.php">

<input type="Text" name="Username" value="Username">
<input type="Submit" name="Submit1" value="Login">

The error:

Notice: Undefined index: Username in C:\wamp\www\basicForm.php on line 5
Call Stack
# Time Memory Function Location
1 0.0000 139824 {main}( ) ..\basicForm.php:0

P.S: It also says "Unauthorized" at the beginning even though I haven't pressed the Login button.