The assumption that any php code will be executed on the html page is incorrect.
You need to create a .php file. In him:
<?php ?> <form action="" method="POST" class="info-profile"> <input type="text" name="name" value="ROBERT SMITH"> <input type="submit"> </form> <?php if (!empty($_POST["name"])) { echo " Получены новые вводные: имя - ".$_POST["name"];} else { echo "Переменные не дошли. Проверьте все еще раз."; } ?>
See how it works on my test site: http://test.kagg.eu/so/632157.php
UPDATE
As a result of clarifying the issue, it turned out that the author created the WordPress page and set up its own php template for it. In the php file of the template there is the following fragment:
?> <form action="" method="POST" class="info-profile"> <input type="text" name="name" value="ROBERT SMITH"> <input type="submit"> </form> <?php if (!empty($_POST["name"])) { echo " Получены новые вводные: имя - ".$_POST["name"];} else { echo "Переменные не дошли. Проверьте все еще раз."; } ?>
Pressing the button displays error 404.
This is because there is a list of reserved words in WordPress that should not be present in GET and POST requests. The word name is in this list.
Here’s how the template file for the page should look like:
<?php /* Template Name: cv */ ?> <form action="" method="POST" class="info-profile"> <input type="text" name="cv_name" value="ROBERT SMITH"> <input type="submit"> </form> <?php if ( isset($_POST['cv_name']) ) { echo " Получены новые вводные: имя - " . $_POST["cv_name"]; } else { echo "Переменные не дошли. Проверьте все еще раз."; } ?>
View a working example here .