This topic is locked
[SOLVED]

 Custom function in the event of a button

1/10/2018 7:46:33 AM
PHPRunner General questions
G
gbhmayer1 author

I am trying to create a function on a button (server side) but it is returning error.
Here is a simple example:
Button SUM
SERVER SIDE
$num01 = 10;
$num02 = 30;
$result["sum"] = calcSum($num01,$num02);
function calcSum($num01,$num02){
return ($num01 + $num02);

}
The error message is: "Call to undefined function calcSum() in ....\buttonhandler.php on line ..."

admin 1/10/2018

You need to put your function to a separate PHP file and plug it in using the technique explained in this article:

https://xlinesoft.com/phprunner/docs/how_to_add_external_files.htm

G
gbhmayer1 author 1/10/2018

SOLVED. thank you so much