Difference between revisions of "EXECPHP()"

From Lianjapedia
Jump to: navigation, search
(Created page with "==Purpose== Function to run multiple lines of PHP code ==Syntax== EXECPHP(<expC>) ==See Also== COMPILE, EXEC(), EXECJAVASCRIPT(), EXECPYTHON(), [[EXECSCRIPT(...")
 
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
 
==Purpose==
 
==Purpose==
Function to run multiple lines of PHP code
+
Function to run PHP code
  
 
==Syntax==
 
==Syntax==
Line 9: Line 9:
  
 
==Description==
 
==Description==
The EXECPHP() function runs multiple lines of PHP code.  The lines of code are contained in <expC>, which can be a text constant, 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.
+
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) + 'print "$i \n";';
+
replace script with 'for ($i = 1; $i <= 10; $i++) {' + CHR(13) + '// process commands;';
 
+ CHR(13) + '}' + CHR(13)
 
+ CHR(13) + '}' + CHR(13)
?execphp(script)
+
execphp(script)
  
 
// Text constant
 
// Text constant
?execphp('for ($i = 1; $i <= 10; $i++) {' + CHR(13) + 'print "$i \n";';
+
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) + 'print "$i \n";';
+
m_script = 'for ($i = 1; $i <= 10; $i++) {' + CHR(13) + '// process commands;';
 
+ CHR(13) + '}' + CHR(13)
 
+ CHR(13) + '}' + CHR(13)
?execphp(m_script)
+
execphp(m_script)
 
</code>
 
</code>
  

Latest revision as of 10:12, 28 March 2017

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)