<?php
if (isset($_POST['submit'])) {
print 'Hello, '.$_POST['name'];
} else {
print<<<_HTML_
<form method="POST" action="$_SERVER[PHP_SELF]">
Your name: <input type="text" name="name"> <br>
<input type="submit" name="submit">
</form>
_HTML_;
} ?>