Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $con = mysqli_connect("mysql10.000webhost.com", "id421257_raje@2a02:4780:bad:c0de::13", "9029118880@R", "id421257_userdetails");
- $username = $_POST["username"];
- $password = $_POST["password"];
- $statement = mysqli_prepare($con, "SELECT * FROM user WHERE username = ? AND password = ?");
- mysqli_stmt_bind_param($statement, "ss", $username, $password);
- mysqli_stmt_execute($statement);
- mysqli_stmt_store_result($statement);
- mysqli_stmt_bind_result($statement, $userID, $name, $age, $username, $password);
- $response = array();
- $response["success"] = false;
- while(mysqli_stmt_fetch($statement)){
- $response["success"] = true;
- $response["name"] = $name;
- $response["age"] = $age;
- $response["username"] = $username;
- $response["password"] = $password;
- }
- echo json_encode($response);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement