<script type="text/javascript"> $(document).ready(function () { $("#submit").click(function () { var login = $("#login").val(); var password = $("#password").val(); var submit = $("#submit").val(); $.post('server.php', {login:login, password:password, submit:submit}, function (data) { $("#block").text(data); }); }); }); </script>
<?php if (filter_has_var(INPUT_POST, 'submit')) { if (empty($_POST['login'])) { ?> <div class="alert alert-danger"> Вы не ввели логин! </div> <?php die(); } }