He problem appears to be that it is ommited an html form to show how the variables are passed to php.
I think that you have to put a form in the end of your code (this is html code):
<form name="test" method="post" action="my_page.php">
<input type="text" name="nameofperson" value="your name here">
and it will appear a form in your page. If you fill a name -i.e. "dai" in the text box and press the "submit" buttom, the next time the page will show "thank you dai"