Basic Insert/Edit PHP Form Example

A techie post today; no comedy or existential woe on this day..
Here is a very basic example of a PHP/HMTL form. The same form is used to insert and edit data, and it submits to itself. This example does not write any data to a database though.
You can view the form and try it here.
Told you it was basic! Once you understand the code though - the prociples can be extended to insert/edit records in a database, and build CMS etc.
Here's the code:
<?php
$name = $_POST['name'];
if ($action == "edit") {
echo "Thank you $name. You can makes changes below if necessary.";
}
?>
<html>
<form method="post" action="form-test.php" >
Name: <input type="text" name="name" value="<?php echo $name; ?>" />
<input type="hidden" name="action" value="edit" />
<input type="submit" name="submit" value="Enter" />
</form>
</html>