Notice: Undefined variable: a_username


#1

Hello everyone I am facing this error :

Notice: Trying to get property of non-object in C:\xampp\htdocs\ionic\users.php on line 36
Notice: Trying to get property of non-object in C:\xampp\htdocs\ionic\users.php on line 37
Notice: Trying to get property of non-object in C:\xampp\htdocs\ionic\users.php on line 38
Notice: Trying to get property of non-object in C:\xampp\htdocs\ionic\users.php on line 39

and this error occurs here :

 $postdata =file_get_contents("php://input");
	 if(isset($postdata)){
		 $request= json_decode($postdata);
		 $a_username = $request->a_username;
		 $p_username = $request->p_username;
		 $password   = $request->password;
		 $vpassword  = $request->vpassword;
 }

my TS:

//insert before constryctor
private baseURI : string  = "http://localhost:10080/ionic/";

 register()
 {
  var body=JSON.stringify({a_username:this.a_username,
									p_username:this.p_username,
									password:this.password,
									vpassword:this.vpassword
									});
 var url = this.baseURI + "users.php";
 this.http.post(url,body)
 .subscribe(re=>{		
	console.log(this.a_username + this.p_username + this.password + this.vpassword);
	
 });
		 
}	

I tried writing $a_username = $request->a_username; as $a_username['a_username'] but the Notice: Undefined variable: a_username this error occurs.

var_dump($request) => NULL
var_dump($postdata) => string(0) ""

Thank you in advance!