Guest User

Untitled

a guest
Mar 20th, 2018
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.34 KB | None | 0 0
  1. <?
  2. if(! defined('BASEPATH') ){ exit('Unable to view file.'); }
  3. $mesaj = '<div class="message info">Connect to Admin Panel</div>';
  4.  
  5. if(isset($_POST['logare'])) {
  6. $name = $db->EscapeString($_POST['login']);
  7. $pass = $db->EscapeString($_POST['pass']);
  8.  
  9. $sql = $db->Query("SELECT id FROM `admins` WHERE `login`='".$name."' AND `pass`=MD5('".$pass."')");
  10. $num = $db->GetNumRows($sql);
  11. if($num > 0) {
  12. $db->Query("UPDATE `admins` SET `online`=NOW() WHERE `login`='".$name."'");
  13. $_SESSION['EX_admin'] = $name;
  14. redirect('index.php');
  15. }else{
  16. $mesaj = '<div class="message error">Wrong Username or Password</div>';
  17. }
  18. }
  19. ?>
  20. <body class="login">
  21. <div class="login-box widget">
  22. <header><h2>Admin Login</h2></header>
  23. <section>
  24. <?=$mesaj?>
  25. <form id="form" method="post">
  26. <p>
  27. <input type="text" id="login" class="full" value="" name="login" required="required" placeholder="Username" />
  28. </p>
  29. <p>
  30. <div class="g-recaptcha" data-sitekey="6LcpyUsUAAAAALnzsp3iizgygeWsfbtzwFeMG8Wx"></div>
  31. <input type="password" id="password" class="full" value="" name="pass" required="required" placeholder="Password" />
  32.  
  33. </p>
  34. <p class="clearfix">
  35. <button class="button button-gray fr" type="submit" name="logare">Login</button>
  36. </p>
  37. </form>
  38. <ul><li><a href="#">Forgot password?</a></li></ul>
  39. </section>
  40. </div>
  41. </body>
Add Comment
Please, Sign In to add comment