Advertisement
mahendradwipurwanto

no4

Jan 29th, 2018
6,893
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.44 KB | None | 0 0
  1. <?php
  2. include 'koneksi.php';
  3. $username   = $_POST['username'];
  4. $password   = $_POST['password'];
  5. $cek        = mysqli_query($connect, "select * from login where username='$username' and password='$password'");
  6. $result   = mysqli_num_rows($cek);
  7. if($result>0){
  8.     $user = mysqli_fetch_array($cek);
  9.     session_start();
  10.     $_SESSION['username'] = $user['username'];
  11.     header("location:welcome.php");
  12. }else{
  13.     header("location:index.php");
  14. }
  15. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement