表单和PHP在一个文件中

I am just tottaly newbie with PHP and I am now learning how to combine PHP with HTML form. I wanted it in one file, so I tried this:

<?php    
if(isset($_POST['button'])){ //check if form was submitted
  $pohlavie = $_POST['gender']; //get input text
  $plat = $_POST['salary']; //get input text
  $plat = "Your gender is ".$pohlavie." and your salary is ".$plat;
}    
?>

<center><h1>TAXES</h1></center>
<form action="" method="post">
Name: <input type="text" name="name"><br>
  <input type="radio" name="gender" value="female"> Female<br>
  <input type="radio" name="gender" value="male"> Male<br>
Salary: <input type="number" name="salary"><br>
<button type="submit" name="button" formmethod="post">Calculate DPH</button>
</form>

Unfortunately, it's literally doing nothing after submitting. Can you please help me a little bit?

Trying the using the following line in place of your current form line:

<form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">`
echo $plat = "Your gender is ".$pohlavie." and your salary is ".$plat;

here is:

 <?php    
 if(isset($_POST['button'])){ //check if form was submitted
 $pohlavie = $_POST['gender']; //get input text
 $plat = $_POST['salary']; //get input text
 echo "Your gender is ".$pohlavie." and your salary is ".$plat;
 }    
 ?>

<center><h1>TAXES</h1></center>
<form action="" method="post">
Name: <input type="text" name="name"><br>
<input type="radio" name="gender" value="female"> Female<br>
<input type="radio" name="gender" value="male"> Male<br>
Salary: <input type="number" name="salary"><br>
<button type="submit" name="button" formmethod="post">Calculate DPH</button>
</form>

Always follow best coding practices and use recommended features. Here the code with little modifications:

<?php
if (filter_has_var(INPUT_POST, "button")) { //check if form was submitted
  $pohlavie = filter_input(INPUT_POST, 'gender'); //get input text
  $salary = filter_input(INPUT_POST, 'salary'); 
  echo $plat = "Your gender is ".$pohlavie." and your salary is ".$salary;
}    
?>

<center><h1>TAXES</h1></center>
<form action="" method="post">
Name: <input type="text" name="name"><br>
  <input type="radio" name="gender" value="female"> Female<br>
  <input type="radio" name="gender" value="male"> Male<br>
Salary: <input type="number" name="salary"><br>
<button type="submit" name="button" formmethod="post">Calculate DPH</button>
</form>

You can also use different type of sanitize filters based on your needs. See here: http://php.net/manual/en/filter.filters.sanitize.php

Also see this post to get more knowledge regarding filter_input: When to use filter_input()

Hope it will help you to learn and follow best practices in PHP.