Advertisement
Raditya48

login.php

Nov 21st, 2018
394
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. <?php
  2. include 'config.php';
  3.  
  4. $username = $_POST['username'];
  5. $password = md5($_POST['password']);
  6.  
  7. $login = mysql_query("select * from user where username='$username' and password='$password'");
  8. $cek = mysql_num_rows($login);
  9.  
  10. if($cek > 0){
  11. session_start();
  12. $_SESSION['username'] = $username;
  13. $_SESSION['status'] = "login";
  14. header("location:admin.php");
  15. }else{
  16. header("location:admin.php");
  17. }
  18.  
  19. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement