Add register form validation
This commit is contained in:
parent
8dacaeb59c
commit
fa65606d2a
3 changed files with 21 additions and 1 deletions
9
includes/assets/js/register.js
Normal file
9
includes/assets/js/register.js
Normal file
|
@ -0,0 +1,9 @@
|
|||
$(function() {
|
||||
$('.ui.form').form({
|
||||
on: 'blur',
|
||||
fields: {
|
||||
email: 'email',
|
||||
password: ['minLength[6]', 'empty'],
|
||||
}
|
||||
});
|
||||
});
|
|
@ -89,6 +89,15 @@ class Page
|
|||
$scriptDefault = 'includes/assets/js/default.js';
|
||||
$scriptDefaultModified = filemtime($scriptDefault);
|
||||
echo '<script defer src="' . $scriptDefault . '?m=' . $scriptDefaultModified . '"></script>';
|
||||
|
||||
/** Page */
|
||||
$scriptPage = 'includes/assets/js/' . $this->name . '.js';
|
||||
|
||||
if (file_exists($scriptPage)) {
|
||||
$scriptPageModified = filemtime($scriptPage);
|
||||
|
||||
echo '<script defer src="' . $scriptPage . '?m=' . $scriptPageModified . '"></script>';
|
||||
}
|
||||
?>
|
||||
|
||||
<title><?= $this->title ?> - wishthis</title>
|
||||
|
|
|
@ -16,7 +16,7 @@ if (isset($_POST['email'], $_POST['password'])) {
|
|||
("' . $_POST['email'] . '", "' . sha1($_POST['password']) . '")
|
||||
;');
|
||||
|
||||
header('Location: ?page=login');
|
||||
header('Location: /?page=login');
|
||||
die();
|
||||
}
|
||||
|
||||
|
@ -38,6 +38,8 @@ $page->navigation();
|
|||
<input type="password" name="password" />
|
||||
</div>
|
||||
|
||||
<div class="ui error message"></div>
|
||||
|
||||
<input class="ui primary button" type="submit" value="Register" />
|
||||
</form>
|
||||
</div>
|
||||
|
|
Loading…
Reference in a new issue