Difference between revisions of "EXECPHP()"
From Lianjapedia
Yvonne.milne (Talk | contribs) (Created page with "==Purpose== Function to run multiple lines of PHP code ==Syntax== EXECPHP(<expC>) ==See Also== COMPILE, EXEC(), EXECJAVASCRIPT(), EXECPYTHON(), [[EXECSCRIPT(...") |
Yvonne.milne (Talk | contribs) |
||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
==Purpose== | ==Purpose== | ||
− | Function to run | + | Function to run PHP code |
==Syntax== | ==Syntax== | ||
Line 9: | Line 9: | ||
==Description== | ==Description== | ||
− | The EXECPHP() function runs | + | The EXECPHP() function runs PHP code. The lines of code are contained in <expC>, which can be a text constant, a filename, a character variable, or a character or memo field. The EXECPHP() function can handle blocks of code. Individual lines of code must be separated by a CHR(13) carriage return character. If a filename.php is specified it is loaded and executed. |
==Example== | ==Example== | ||
Line 19: | Line 19: | ||
select scripts | select scripts | ||
append blank | append blank | ||
− | replace script with 'for ($i = 1; $i <= 10; $i++) {' + CHR(13) + ' | + | replace script with 'for ($i = 1; $i <= 10; $i++) {' + CHR(13) + '// process commands;'; |
+ CHR(13) + '}' + CHR(13) | + CHR(13) + '}' + CHR(13) | ||
− | + | execphp(script) | |
// Text constant | // Text constant | ||
− | + | execphp('for ($i = 1; $i <= 10; $i++) {' + CHR(13) + '// process commands;'; | |
+ CHR(13) + '}' + CHR(13)) | + CHR(13) + '}' + CHR(13)) | ||
// Memory variable | // Memory variable | ||
− | m_script = 'for ($i = 1; $i <= 10; $i++) {' + CHR(13) + ' | + | m_script = 'for ($i = 1; $i <= 10; $i++) {' + CHR(13) + '// process commands;'; |
+ CHR(13) + '}' + CHR(13) | + CHR(13) + '}' + CHR(13) | ||
− | + | execphp(m_script) | |
</code> | </code> | ||
Latest revision as of 10:12, 28 March 2017
Contents
Purpose
Function to run PHP code
Syntax
EXECPHP(<expC>)
See Also
COMPILE, EXEC(), EXECJAVASCRIPT(), EXECPYTHON(), EXECSCRIPT()
Description
The EXECPHP() function runs PHP code. The lines of code are contained in <expC>, which can be a text constant, a filename, a character variable, or a character or memo field. The EXECPHP() function can handle blocks of code. Individual lines of code must be separated by a CHR(13) carriage return character. If a filename.php is specified it is loaded and executed.
Example
create table if not exists scripts (script char(200)) if not used("scripts") use scripts endif select scripts append blank replace script with 'for ($i = 1; $i <= 10; $i++) {' + CHR(13) + '// process commands;'; + CHR(13) + '}' + CHR(13) execphp(script) // Text constant execphp('for ($i = 1; $i <= 10; $i++) {' + CHR(13) + '// process commands;'; + CHR(13) + '}' + CHR(13)) // Memory variable m_script = 'for ($i = 1; $i <= 10; $i++) {' + CHR(13) + '// process commands;'; + CHR(13) + '}' + CHR(13) execphp(m_script)