In calculate.php I have this code:
//recovery the variables from an html form
$FirstNumber=$_POST['FirstNumber'];
$SecondNumber=$_POST['SecondNumber'];
$Operation=$_POST['Operation']; //this can be '+', '-', '*', '/'.
//Now I have to call specific instructions in instructions.php (Which is the one for operations) sending to it my variables
//Now I have to recovery $result from instructions.php
echo "Result: $result";
Assume that in instructions.php I have this:
The page need to understand what instruction it have to do, in this case the ones from Operations sector
//-----Operations-------------------------------------------------------------------------
//recovery variables from calculate.php
//Tottaly doesen't know how
switch ($Operation){
case "+":
$result=$FirstNumber+$SecondNumber;
//Now I send the result in calculate.php
break;
//repeat for all the possible cases
}
//------Strings---------------------------------------------------------------------------
$control=$String;
if ($checked){
$control=$String."_Controlled";
//I have to return $control
}else {
$checked=true;
$control=$String."_Controlled";
//return $control
}
//------Other instructions for other requests---------------------------------------------
So, How can I "define" and call a series of instruction from another php page?
Please don't answer me with the "meta refresh" method, it's not what I'm looking for and what I asked.