Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function hide()
- {
- $('#1').hide();
- $('#2').hide();
- $('#3').hide();
- $('#4').hide();
- }
- function echoData(data)
- {
- if(data == 1)
- {
- $('#1').show();
- setTimeout(function()
- {
- $('#1').hide();
- }, 15000);
- }
- if(data == 2)
- {
- $('#2').show();
- setTimeout(function()
- {
- $('#2').hide();
- }, 15000);
- }
- if(data == 3)
- {
- $('#3').show();
- setTimeout(function()
- {
- $('#3').hide();
- }, 15000);
- }
- if(data == 4)
- {
- $('#4').show();
- setTimeout(function()
- {
- window.location = 'home.php';
- $('#4').hide();
- }, 1000);
- }
- }
- function login()
- {
- hide();
- $.post('modules/login.php',
- {
- username: $('#username').val(),
- password: $('#password').val(),
- port : $('#port').val()
- }
- )
- .done(function(data)
- {
- echoData(data);
- });
- }
- $('#loginform').submit(function(event)
- {
- login();
- event.preventDefault();
- });
- $(document).ready(function()
- {
- hide();
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement