you can use submit instead of button. try to analyze this code.
//assume that the file name of this script is test.php
<?php
if($_POST['submit']=="Test")
{
echo "test";
}
echo "<form action='test.php' method='post'>";
echo "<input type='submit' name='submit' value='Test'>";
echo "</form>";
?>