I'm started to learn PHP only some weeks ago, and I have a problem with posting a value from form. Code:
<!DOCTYPE html>
<html>
    <head>
    </head>
    <body>
        <form action="<?php echo htmlspecialchars($_SERVER['PHP_SELF']);?>" 
method="POST">
            <input type="text" name="name">
            <br/>
            <input type="submit">
        </form>
        <?php 
            echo $_POST['name'];
        ?>
    </body>
</html>
It displays an error But when I try to write something in the input field, it is working perfectly


 
    