you might want to read
some php tutorials.
but basically, for the example you give. You would have some html page that has the form you gave, and a post.php file that would handle form when submitted. A simple example where you want the submitted info to be written to a file would go something like this:
<?php
$name = $_POST['habb']; // get the text from the input field with name 'habb'
$pw = $_POST['password'];
$file = "sometextfile.txt";
$fp = fopen($file, "a+"); //get a file pointer in append mode
fwrite($fp, "name: " . $name . "\npassword: " . $pw . "\n\n"); //write a string to that file
fclose($fp); // close the file pointer
?>