Error? Google?
Welcome to the nuBuilder Forums!
Register and log in to access exclusive forums and content available only to registered users.
Register and log in to access exclusive forums and content available only to registered users.
Retrieve data from a web api in json format Topic is solved
-
- Posts: 315
- Joined: Sun Mar 14, 2021 8:48 am
- Location: Geneva
- Has thanked: 87 times
- Been thanked: 11 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: 4297
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 445 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: 4297
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 445 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.