From: Adam S. <a.s...@gm...> - 2007-05-26 14:52:17
|
Hello to all I was trying to construct a eval function for the ActionApps with the objective to avoid to be constructing specific functions in item.php3 whenever I need one. I use the following syntax {eval:<php expresion>} With that purpose, I put in the file stringexpand.php3 the following code /*****************************************************************************************************/ elseif ( substr($out, 0, 4) == "eval" ) { $parts=split(":",$out); if (isset($debug)) huhl ("function eval is=",$parts[1]);// $valor = QuoteColons($level, $maxlevel, $parts[1]); $valor_eval=eval ($valor); return $valor_eval; } /*****************************************************************************************************/ The alias works well with simple expressions, like {eval:$a=5;return $a;} {eval:$a=5;$b=10;$c=$a+$b;return $c;} {eval: $b='{text...........5}';return $b;} but it leaves error to me when use native functions php {eval: $b=strtolower('{text...........5}');return $b;} the error that leaves Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/asocam/public_html/apc-asocam/include/stringexpand.php3(774) : eval()'d code on line 1 when I use {eval: $b=5; $a=13; if ($b>$a) {return $b." es mayor";}else {return $a." es menor";}} the error that leaves Parse error: syntax error, unexpected T_STRING, expecting '(' in /home/asocam/public_html/apc-asocam/include/stringexpand.php3(774) : eval()'d code on line 1 Some idea to continue advancing? Regards, Adam |