Home › Forums › Design › Trapping and storing Json data › Reply To: Trapping and storing Json data
August 1, 2017 at 11:55 am
#257288
Gadgee
Participant
Thanks as ever..
Have got my code looking like the examples you mention and submitted another form to trigger a Json call to the page.
This time “Mickey Mouse” appears in the json_data.txt file but nothing else.
Just to see what happens, I put the fopen statement at the head of the PHP block and inserted these lines to see if the error condition was written to file…
if ($contact == null && json_last_error() !== JSON_ERROR_NONE) {
$txt= "Error reading JSON:\n";
fwrite($myfile, $txt);
}
The file only contains “Mickey Mouse” which suggests that there was no error condition encountered.
#