Call Script from within script on server
Posted: Thu Oct 31, 2019 6:53 pm
Hi Guys
I hope that everyone is well.
Is it possible to call another script from within a script held on a the hosted server (the same way as you call a script only stack when working in a local environment)
EXAMPLE:
If you have an app that sends a post to a script on the LiveCode server (I'll give a simplified version below)
-local app sends post to server based script
- Server receives request
-the script_connect_to_db should then be called
-it should then pass the connection id t_id_connection_hosted back to the original script
- then the connection should be closed
Many Thanks
HRCAP
I hope that everyone is well.
Is it possible to call another script from within a script held on a the hosted server (the same way as you call a script only stack when working in a local environment)
EXAMPLE:
If you have an app that sends a post to a script on the LiveCode server (I'll give a simplified version below)
-local app sends post to server based script
- Server receives request
Code: Select all
put $_POST["INSTRUCTION"] into t_instruction
if t_instruction is "run_second script" then
script_connect_to_db --this should call another script held on the server
put the result into t_id_connection_hosted
revclosedatabase t_id_connection_hosted
end if
-the script_connect_to_db should then be called
Code: Select all
put revOpenDatabase("mysql","test.livecodehosting.com","test_db","test_user","test_password") into t_id_connection_hosted
put t_id_connection_hosted
-it should then pass the connection id t_id_connection_hosted back to the original script
- then the connection should be closed
Many Thanks
HRCAP