I am trying to do a simple comment box in my webpage, and followed an online tutorial to make one. I followed the instructions exactly, but mine doesn't work. This is the code that I have:
<?php
if(isset($_POST['submit'])) {
$fullname = $_POST['fullname'];
echo $fullname;
}
?>
<html>
<head>
<title>Undefined Index Example</title>
</head>
<body>
<div style="margin: 100px auto 0;width: 300px;">
<h3>HTML Form</h3>
<form name="form1" id="form1" action="" method="post">
<fieldset>
Enter Full Name <input type="text" name="fullname" placeholder="Full Name" />
<br />
<input type="submit" name="submit" value="Submit" />
</fieldset>
</form>
</div>
</body>
</html>
The problem seems like the name of the input type is not linked with my php part. For example, the php submit is not linked to the html submit, so it does nothing. I have no idea how to fix this, and is very frustrating. Please help.