Date:  05/21/2019 02:29:39 PM Msg ID:  004988
From:  Olatunji Beckley Thread:  004986
Subject:  Re: Call PHP script within Foxweb script
Thanks a lot. Will explore the options and settle for the one that's best for my situation.
Sent by FoxWeb Support on 05/20/2019 06:03:59 PM:
Both FoxWeb and PHP work directly on requests received from the Web server, so you can't "call" a PHP script from a FoxWeb script. The only way to use both FoxWeb and PHP in the same application is to route data through the browser:
 
Option 1: If you don't have a lot of data, then the easiest way is to return an HTTP redirect from a FoxWeb script, pointing to the URL of your PHP script. Any data you want to pass can be part of the query string (at the end of the URL, after the "?" character). Note that data will need to be URL encoded.
 
Option 2: If you want to pass a large amount of data (more than a few thousand bytes) you may want to return an HTML page to the browser, containing a form with the data you want to pass to PHP. You can either ask the user to submit the form, or you can place the data in hidden fields and auto-submit through JavaScript.
 
When the PHP script is done, you can use one of the above techniques to return the user back to your FoxWeb scripts.
 
One final possibility would be to utilize an HTTP COM object to make a direct HTTP request from your FoxWeb script to the PHP script. Basically, instead of having the browser make this request, you will construct a URL similar to option one, but everything will happen on the server. This is similar to making a server-to-server API request, but I don't know your circumstances and whether this makes sense.
 
FoxWeb Support Team
support@foxweb.com email
Sent by Olatunji Beckley on 05/20/2019 01:19:51 AM:
Hi all,
 
Does anyone know how to call a php script from a foxweb script without using the form submit technique (i.e. specifying a php file to submit data to).
 
I would like to call the php script after data submission and validation in the foxweb script.
 
TIA.