Created
June 1, 2017 12:43
-
-
Save andimariadi/a535e1a1f3322be5ce597441b33a8525 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| session_start(); | |
| include 'koneksi.php'; | |
| if (isset($_POST['login'])) { | |
| $email = $_POST['email']; | |
| $sandi = md5($_POST['sandi']); | |
| $login = mysql_query("SELECT `no_user`, `nama` FROM `tb_user` WHERE `email`='$email' and `sandi`='$sandi'"); | |
| if(mysql_num_rows($login)=='0'){ | |
| echo '<script>alert(\'Email dan kata sandi salah!\');</script>'; | |
| } else { | |
| $data = mysql_fetch_array($login); | |
| $_SESSION['no'] = $data['no_user']; | |
| header('location: index.php'); | |
| } | |
| } | |
| #script by pemulabelajar.com | |
| ?> | |
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1"> | |
| <!-- Script by pemulabelajar.com --> | |
| <title>Login - Pemula Belajar</title> | |
| <link rel="stylesheet" type="text/css" href="styles.css"/> | |
| </head> | |
| <body> | |
| <div class="header"> | |
| MediaSosialku.com | |
| </div> | |
| <div class="navigasi"> | |
| <li><a href="index.php">Home</a></li> | |
| </div> | |
| <div class="sidebar"> | |
| <p>Anda diwajibkan untuk login terlebih dahulu sebelum mengakses beranda sosialmediaku.com</p> | |
| </div> | |
| <div class="content"> | |
| <p>Form Login User</p> | |
| <form method="post"> | |
| <p>Email :</p> | |
| <input name="email" type="email" placeholder="Masukkan Email" /> | |
| <p>Sandi :</p> | |
| <input name="sandi" type="password" placeholder="Masukkan Sandi"/> | |
| <p><button type="submit" name="login">Login</button> Belum mempunyai akun ? <a href="daftar.php">Daftar</a></p> | |
| </form> | |
| </div> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment