php if isset _POST submit AND empty _POST username AND empty _POST pas

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php
if(isset($_POST['submit']) AND !empty($_POST['username']) AND !empty($_POST['password']))
system::self()->user->auth($_POST['username'], $_POST['password']);
if(system::self()->user->isLogged()) {
?>
<h3>Profile</h3>
<?php }
else { ?>
<h3>Авторизация</h3>
<form action="" method="post" enctype="multipart/form-data" name="auth" id="auth">
<div class="wrap">
<div class="field">
<label for="login">Логин:</label>
<input type="text" name="login" id="login" />
</div>
<div class="clear"></div>
<div class="field">
<label for="password">Пароль:</label>
<input type="password" name="password" id="password" />
</div>
<div class="clear"></div>
<div class="field from-center">
<input class="button" type="submit" name="submit" id="submit" value="Войти" />
</div>
<div class="from-center links"><a href="#">Регистрация</a> | <a href="#">Забыли пароль?</a></div>
<div class="clear"></div>
</div>
<div class="clear"></div>
</form>
<?php } ?>