No way to keep input text data after submit?

0

I wanted to keep the form data, after giving a submit on the page. Is there no way at all?

    
asked by anonymous 06.06.2016 / 02:16

1 answer

0
<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title></title>
    </head>
    <body>
        <form action="" method="POST" >
            <?php
              $user = (!empty($_POST['user'])) ? $_POST['user'] : '';
             ?> 
            <input type="text" name="user" id="user" value="<?php echo htmlentities( $user ) ; ?>" />
            <input type="submit" value="Enviar" />
        </form>

    </body>
</html>
    
06.06.2016 / 03:06