Hi
I need to submit Formidable Form entry data (e.g. Age and Value) to my Python script for some complex calculations before returning the results to be displayed in the same Wordpress page containing the Form.
I gave a simple sample below of what the page with the Formidable Form will look like.
Sample page containing Form at the top and result to be displayed.
Age: 32
Value: 1000
Calculate (Submit) button
________________________
Result: [to be returned after processing using Python Script]
As a WordPress plugin, Formidable is written in PHP. You can pass values to Python using a Hook or through Ajax and feed the new values back to Formidable. See this stackoverflow question about executing Python scripts from PHP: https://stackoverflow.com/questions/19735250/running-a-python-script-from-php. One thing to be aware of is that many hosts disable PHP exec() because it can be used to breach server security.
Hi
Appreciate your help. I am wondering instead of using Hook, can I use REST API?
What are the conditions that I can use REST API?
Thanks in advance.
You use the REST API when you're moving data to and from a REST endpoint. REST endpoints are web based. Python is a server platform, not REST.
Please login or Register to submit your answer