Hello, I´m new to nubuilder and i'm asking some guidance in this subject:
I'm trying to run a procedure with "nuRunPHPHiddenWithParams": Starting the procedure seems to work fine since the "#param#" is created and displayed in the form info table:
param "BxZwYXJhbTEWAxYxMjM0NTYWAhZwYXJhbTIWAxYyMzE2NTQ1NDQ1NjQWBw=="
inside the php code the base64_decode("#param#") also seems to work fine since:
$param=base64_decode('#param#');
nuDebug($param);
returns [0] : param1123456param2231654544564
what doesn't work is the $param=json_decode($param,false) since i'm unable to retrieve anything from the object with:
§par1=$param->param1
and also $param=json_decode(base64_decode('#param#'); apparently doesn't create the object.
I separated the "base64_decode" and "json_decode" functions for debugging purposes only.
Any sort of comment or suggestion would be very appreciated.
Welcome to the nuBuilder Forums!
Join our community by registering and logging in.
As a member, you'll get access to exclusive forums, resources, and content available only to registered users.
Join our community by registering and logging in.
As a member, you'll get access to exclusive forums, resources, and content available only to registered users.
nuRunPHPHiddenWithParams
-
- nuBuilder Team
- Posts: 4564
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 76 times
- Been thanked: 529 times
- Contact:
Re: nuRunPHPHiddenWithParams
Hi,
nuBase64encode() is somehow flawed. Try replacing nuRunPHPHiddenWithParams() with
My test:
JS:
PHP:
nuBase64encode() is somehow flawed. Try replacing nuRunPHPHiddenWithParams() with
Code: Select all
function nuRunPHPHiddenWithParams(i, paramName, paramValue, rbs) {
nuSetProperty(paramName, btoa(JSON.stringify(paramValue)));
nuRunPHPHidden(i, rbs);
}
JS:
Code: Select all
nuRunPHPHiddenWithParams('test_procedure', 'param', {param1: '12345'}, 0);
Code: Select all
$param = json_decode(base64_decode('#param#')); // retrieve the parameters
$param1 = $param->param1;
nuDebug($param1); // returns 12345