This question already has an answer here:
I'm working with db connection, from what it looks like to me when I finish writing it on sublime there's no error. so, I decided to write localhost/*folder*/*filename*.php
in my browser to check the connection and suddenly the browser display;
Notice: Undefined index: username in C:\xampp\htdocs\Login\login.php on line 4 Notice: Undefined index: pincode in C:\xampp\htdocs\Login\login.php on line 5 {"success":false}
<?php
$con = mysqli_connect("localhost", "root", "", "test");
$Username = $_POST["username"];
$Pincode = $_POST["pincode"];
$statement = mysqli_prepare($con, "SELECT * FROM users WHERE username = ? AND pincode = ?");
mysqli_stmt_bind_param($statement, "ss", $Username, $Pincode);
mysqli_stmt_execute($statement);
mysqli_stmt_store_result($statement);
mysqli_stmt_bind_result($statement, $id, $Username, $Pincode);
$response = array();
$response["success"] = false;
while(mysqli_stmt_fetch($statement)){
$response["success"] = true;
$response["id"] = $id;
$response["username"] = $Username;
$response["pincode"] = $Pincode;
}
echo json_encode($response);
?>
</div>