Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include "conn.php";
- $conn = mysqli_connect(HOST, USER, PASS, DB);
- $username = $_GET['user'];
- $password = $_GET['pass'];
- $sql = "select * from user where username='$username' and password='$password'";
- $result = mysqli_query($conn, $sql);
- $tmp = array();
- if (mysqli_num_rows($result) == 1) {
- while ($row = mysqli_fetch_array($result)) {
- $tmp["status"] = "success";
- }
- } else {
- $tmp["status"] = "gagal";
- }
- // json output
- header('Content-Type: application/json');
- echo json_encode($tmp);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement