PHP_Execute ( phpCode {; keepMemory {; timeoutSeconds }} )
Description
Allows you to execute PHP code and get the results.
Parameters
phpCode
(required)
The PHP code to execute.
keepMemory
(optional)
Used to indicate that values of the PHP code execution in memory should be kept from the previous execution.
timeoutSeconds
(optional)
The number of seconds to wait for execution to complete. The default timeout is 60 seconds but this can be changed using PHP_Timeout.
Return
Returns the result of the PHP code.
Errors
201 Timeout
202 PHP error
203 User cancelled
204 FileMaker error
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
PHP_Execute ( "echo 'Hello world!';" ) /* Returns: Hello world! */ |
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
PHP_Execute ( "sleep( 2 ); echo 'timeout';" ; 0 ; 1 ) // Sleep for 2 seconds but timeout after 1 second /* Returns: 201 Timeout */ |
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
PHP_Execute ( "print_r(implode(chr(13), scandir(FM_DOCUMENTS_PATH)));" ) /* Returns: Directory listing of your documents folder */ |
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
PHP_Execute ( "echo file_get_contents('http://www.google.com/#q=FileMaker');" ) /* Returns: Google search results for 'FileMaker' */ |