SHARE
TWEET

Untitled

Gikumo Mar 20th, 2016 95 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. include "DBconfig.php";
  3. $username = $_POST['username'];
  4. $password = $_POST['password'];
  5. if (empty($username)){
  6. echo "<script>alert('Username belum diisi')</script>";
  7. echo "<meta http-equiv='refresh' content='1 url=login.php'>";
  8. }else if (empty($password)){
  9. echo "<script>alert('Password belum diisi')</script>";
  10. echo "<meta http-equiv='refresh' content='1 url=login.php'>";
  11. }else{
  12. session_start();
  13. $login = mysql_query("select * from users where username='$username' and password='$password'");
  14. if (mysql_num_rows($login) > 0){
  15. $_SESSION['username'] = $username;
  16. header("location:index.php");
  17. }else{
  18. echo "<script>alert('Username atau Password salah')</script>";
  19. echo "<meta http-equiv='refresh' content='1 url=login.php'>";
  20. }
  21. }
  22. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top