Advertisement
Guest User

Untitled

a guest
Aug 26th, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. //ini script cek_login.php
  2. <?php
  3. session_start();
  4.  
  5. include"../config/koneksi2.php";
  6.  
  7. $u=mysqli_query($conn, "SELECT * FROM admin WHERE user_name ='".$_POST['username']."' AND password='".md5($_POST['pwd'])."'");
  8. $jml=mysqli_num_rows($u);
  9. if($jml == 1){
  10. header('Location: admin.php');
  11. $_SESSION['username'] = $_POST['username'];
  12. }else{
  13. echo "gagal";
  14. }
  15.  
  16. ?>
  17.  
  18. //ini script koneksi2.php
  19.  
  20. <?php
  21. $servername = "localhost";
  22. $database = "db_sipil";
  23. $username = "root";
  24. $password = "";
  25.  
  26. $conn = mysqli_connect($servername, $username, $password, $database);
  27. // mengecek koneksi
  28.  
  29. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement