Advertisement
azmil

proseslogin

May 14th, 2016
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.69 KB | None | 0 0
  1. <?php
  2.     require_once("connect.php");
  3.     ob_start();
  4.     $username=$_GET['username'];
  5.     $password=$_GET['password'];
  6.     $query=mysql_query("select * from tuser where username='$username' and password='$password'");
  7.     $row_user=mysql_fetch_assoc($query);
  8.     if (($username!="")&&($password!=""))
  9.     {
  10.         if (($username==$row_user['username'])&&($password==$row_user['password']))
  11.         {
  12.             session_start();
  13.             session_register('username');
  14.             session_register('password');
  15.             header("location:admin/index.php");
  16.            
  17.         }
  18.         else
  19.         {
  20.             echo "<script>alert('password salah');location.href='index.php'</script>";
  21.         }
  22.     }
  23.     else
  24.     {
  25.         echo"<script>alert('kosong coy');location.href='index.php'</script>";
  26.     }
  27. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement