Adding new element to page with PHP
I'm setting up a registration page, and I'm adding checks right now for
forms that are left empty.
Here's the HTML I have for the username form:
<label>Username</label>
<div class="form-group">
<input name="username" maxlength="25" class="span-default" type="text"
placeholder="Choose a username">
</div>
And the PHP I have:
$username = $_POST['username'];
if(empty($username)) {
// todo
}
What I need for the "todo" portion of the PHP to do is to add a new line
under the input form in the HTML, like this:
<label>Username</label>
<div class="form-group">
<input name="username" maxlength="25" class="span-default" type="text"
placeholder="Choose a username">
<div class="form-warning">This username is already taken!</div>
</div>
How can I do this?
No comments:
Post a Comment