angganurfaizal5 / salahnya dimana yah ??

28 Dec 2017 at 04:30

Download

php

1 <?php
2 session_start();
3 ?>
4
5 <?php
6 require_once 'fungsi/koneksi.php';
7 if(isset($_POST['submit'])){
8 $username = $_POST['username'];
9 $password = $_POST['password'];
10
11 $query = "SELECT iduser,username,admin,fullname FROM user WHERE username='$username' AND password=md5('$password')";
12 $hasil = mysqli_query($kon, $query);
13 if(mysqli_num_rows($hasil) > 0){
14 list($iduser,$username,$admin,$fullname) = mysqli_fetch_array($hasil);
15
16 //session_start()
17 $_SESSION['iduser'] = $iduser;
18 $_SESSION['username'] = $username;
19 $_SESSION['admin'] = $admin;
20 $_SESSION['fullname'] = $fullname;
21
22 echo "<script>alert('Selamat Datang');document.location='mainform.php?halaman=home'</script>";
23 }else {
24 echo "<script>alert('Username Atau Password Salah !');document.location='index.php'</script>";
25 }
26 }
27 ?>
28
29 <!DOCTYPE html>
30 <html>
31 <head>
32 <title>SPP : Syamsul 'Ulum</title>
33 <link rel="stylesheet" type="text/css" href="css/style.css">
34 </head>
35 <body>
36 <form method="post" action="">
37 <div id="formlogin">
38 <h2><strong>APLIKASI<br>PEMBAYARAN SPP <div class="rb">SMK YASPI SYAMSUL 'ULUM<br>KOTA SUKABUMI</div></strong></h2>
39 <input type="text" name="username" class="control" placeholder="Username" required>
40 <input type="password" name="password" class="control" placeholder="Password" required>
41 <input type="submit" class="btn-login" name="submit" value="LOGIN">
42 </form>
43 </div>
44 </body>
45 </html>

Comments (2)

ojixzzz30 Dec 2017 at 06:34

lha salahnya dimana :?

adierebel30 Dec 2017 at 06:38

line kedua