Error? Google?
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.
Retrieve data from a web api in json format Topic is solved
-
- nuBuilder Team
- Posts: 4581
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 76 times
- Been thanked: 536 times
- Contact:
-
- Posts: 348
- Joined: Sun Mar 14, 2021 8:48 am
- Location: Geneva
- Has thanked: 94 times
- Been thanked: 12 times
Re: Retrieve data from a web api in json format
I know that it doesn't work because I have put it behind an input button under custom code, event onclick.
If I put onclick event the following code :
--> no message, the system is blocked on the first line.
If I put onclic event :
--> the message appears. I conclude that curl_init() isn't recognized. How can I retrieve the error msg ?
Many thanks for your help
Yves
If I put onclick event the following code :
Code: Select all
$ch=curl_init();
nuMessage('test curl');
If I put onclic event :
Code: Select all
$ch='test curl';
nuMessage($ch);
Many thanks for your help
Yves
-
- nuBuilder Team
- Posts: 4581
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 76 times
- Been thanked: 536 times
- Contact:
Re: Retrieve data from a web api in json format
You can't run PHP code in the browser. It has to be placed in a procedure.
-
- nuBuilder Team
- Posts: 4581
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 76 times
- Been thanked: 536 times
- Contact:
Re: Retrieve data from a web api in json format
1. Add a Procedure with code e.g. retrieve_data
Builders -> Procedure -> Add
2. To run it, add this JS to a button's onclick event:
Builders -> Procedure -> Add
2. To run it, add this JS to a button's onclick event:
Code: Select all
nuRunPHPHidden('retrieve_data', 0);
You do not have the required permissions to view the files attached to this post.