Does anyone has an Idea how to get the POST value send to the php file through the same php response wrapped with JSON?
What I did so far was to send username and password to server side authentication. But it triggers an error of field missing. So I want to check the received data at the server side at the console.
if(isset($_POST['u_name']) && isset($_POST['u_pass'])){
$username = $_POST['u_name'];
$pass = $_POST['u_pass'];
} else {
// required field is missing
$response["success"] = 0;
$response["message"] = "Required field(s) is missing" + $_POST['u_name'] + $_POST['u_name']; // <--- this is my line 48
// echoing JSON response
echo json_encode($response);
}
But I 'm getting an error like this
<br />
<b>Notice</b>: Undefined index: u_name in <b>C:\xampp\htdocs\TestCordova\login_check.php</b> on line <b>48</b><br />
<br />
<b>Notice</b>: Undefined index: u_name in <b>C:\xampp\htdocs\TestCordova\login_check.php</b> on line <b>48</b><br />
{"success":0,"message":0}