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