I have the following post from my form in Angular:
$postdata = file_get_contents("php://input");
$request = json_decode($postdata);
@$id = $request->id;
@$cid = $request->cid;
@$description = $request->description;
@$type = $request->type;
@$owner = $request->owner;
@$ssamount = $request->ssamount;
if($owner == 'spouse' && $type == 'ira')
{$exempt == 'yes'};
if(mysqli_connect_errno()) { Etc...
What I am trying to accomplish is to place some logic in PHP as opposed to client side. If the two variables from the Angular JSON posted file match a criteria as shown, I want another field in the MYSQL database to be set to yes or no. $exempt in the above.
I get no errors but it does not change the field in MYSQL. I think the problem might be related to the structure of the decoded JSON or that I might have to add this JSON object to $postdata before decoding it.
Any ideas? Thank you