Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $con = mysqli_connect("mysql12.000webhost.com", "a5340628_user", "118sandy118", "a5340628_data");
- $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, $username, $age, $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