Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require "koneksi.php";
- $nama = $_POST['username'];
- $pass = $_POST['password'];
- $query = "SELECT * from table_login where username = '$nama' AND password = '$pass';";
- $result = mysqli_query($conn, $query);
- $row = mysqli_fetch_array($result);
- if (mysqli_num_rows($result) > 0) {
- $response = array();
- $code = "login_true";
- $message = "Welcome to Apps My Application.";
- array_push($response, array("code"=>$code, "pesan"=>$message));
- echo json_encode(array("Server"=>$response));
- }else{
- $response = array();
- $code = "login_false";
- $message = "Maaf data anda belum terdaftar..!";
- array_push($response, array("code"=>$code, "pesan"=>$message));
- echo json_encode(array("Server"=>$response));
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment