Created
November 29, 2017 09:23
-
-
Save udibagas/7524bc392cfdfbc605eac954d0d6dfa4 to your computer and use it in GitHub Desktop.
This file contains 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 | |
include "../koneksi.php"; | |
@session_start(); | |
$username = mysqli_real_escape_string($konek, $_POST['username']); | |
$password = mysqli_real_escape_string($konek, $_POST['password']); | |
$password = md5($password); | |
$sql = "SELECT * FROM register WHERE email='$username' AND password='$password' AND status='Y'"; | |
$result = $konek->query($sql); | |
$num_row = $result->num_rows; | |
if( $num_row > 0 ) { | |
$row=$result->fetch_assoc(); | |
$_SESSION['username']=$row['nama']; | |
$_SESSION['level']=$row['level']; | |
$_SESSION['id_req']=$row['id_register']; | |
echo 1; // BARIS INI YANG DIUBAH, TADINYA 'true' ubah jadi 1 | |
} else { | |
echo 0; // BARIS INI YANG DIUBAH, TADINYA 'false' ubah jadi 0 | |
} | |
$konek->close(); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment