[Solved] Simple PHP Callback Not Working

geowil11geowil11 Member, PRO Posts: 5
edited December 2018 in Working with GS (PC)

Title says it all. I am trying to test my php code's callback response but I am always seeing "0" in the text display actor I have set up to show the value returned.

Here is my php code:

if (!empty($_POST)) {
        if (!empty($_POST["params"])) {
            $decoded = json_decode($_POST["params"]);

            $dataProps = $decoded->Children{1}->Properties;
            print_r($dataProps);

            foreach ($dataProps as $data){
                foreach ($data as $key=>$val){
                    $dataArr = explode("|",$val);

                    if (count($dataArr) > 2){
                        //print_r($dataArr);
                        if (newAppData(intval($dataArr[1]), intval($dataArr[2]), $dataArr[3], intval($dataArr[4]), $dataArr[5], intval($dataArr[6]), intval($dataArr[7]))){
                            echo json_encode(array('Status'=>'Success'));
                        } else{
                            echo json_encode(array('Status'=>'Fail'));
                        }
                    } else{
                        echo json_encode(array('Status'=>'Fail'));
                    }
                }
            }
        } else {
            echo json_encode(array('Status'=>'Fail'));
        }
    } else{
        echo json_encode(array('Status'=>'Fail'));
    }

Does not matter if I induce a success or fail callback, the callback attribute value is always 0. I know the code is working as I am seeing my test file being written to with the data I have in the table I am sending.

Comments

Sign In or Register to comment.