Running PHP scripts server side

Hi guys, been having a play about with Wappler over the past week and so far I’m blown away at the functionality and easier of use.

I have been having a play about with a Twilio PHP file to send an SMS once a button is clicked. I have this working in the front end by executing the PHP file and passing variables, which is working great. Problem I have is the when the button is clicked it opens the PHP script and the output is shown on screen, I’ve set this to redirect back to the page once complete, but ideally I would like this to happen in the background without forwarding to the script. This then has implications on showing notifications etc

Is it possible to set this up under server connect so this all happens in the background?

Thanks

Is this a Twilio API data you are using?

Yes, I believe the script is using the API, but at the moment I’m running it through their provided PHP script

After a small look at their website it looks like it is easy to implement with Server Connect and the API Connector. Check the documentation for curl, it shows the exact calls that needs to be done to the endpoint.

For creating an SMS it is a POST to https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/Messages.json.

Input data are From, To and Body.

Set Authorization to Username, as User Name use the AccountSid and for the Password the AuthToken.

2 Likes

Many thanks Patrick - this worked amazingly well!