As you can see, it is not PHP5 or even a PHP question at all.
Basic HTML knowledge is a must for anyone who wants to be a PHP user.
And using templates, it looks more neat:
Getting the code of the data part:
$username = ""; if isset($_POST['username'])) $username = htmlspecialchars($_POST["username"]);
And the template code:
<input type="text" name="username" value="<?=$username?>">
If you divide the code into 2 parts, it will become more convenient and readable.
Your common sense
source share