Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- form login <html>
- <head>
- <title>Halaman Bearanda Warga</title>
- <link rel="stylesheet" type="text/css" href="styles.css" >
- </head>
- <body>
- <section><div class="box-login">
- <form action="" method="post">
- <input type="text" name="email" placeholder="email"/><br>
- <input type="password" name="pass" placeholder="password"/><br>
- <input type="submit" name="masuk" value="masuk"/><br>
- </form>
- <?php
- include "koneksi.php";
- if(isset($_POST['masuk'])){
- $cek = mysqli_query($conn, "SELECT * FROM user WHERE
- email = '".$_POST['email']."' AND password = '".$_POST['pass']."'");
- $hasil = mysqli_fetch_array($cek);
- $count = mysqli_num_rows($cek);
- $nama_user = $hasil['nama'];
- if($count > 0){
- session_start();
- $_SESSION['nama'] = $nama_user;
- header("location:index.php");
- }else{
- echo "gagal";
- }
- }
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement