virap Posted April 25, 2021 Posted April 25, 2021 (edited) In my custom php block I am simply trying to include a php file and echo a variable from the external file like this: Quote include(/path/public_html/test.php); echo $ztest3; But I include the path I get errors, see attached. If I don't include a full pth and simply say include (test.php); then there is no output from the variable. What am I doing wrong? Thanks. Edited April 25, 2021 by virap
virap Posted April 25, 2021 Author Posted April 25, 2021 Thank you very much. I work with a php block, is the syntax the same as for the template?
virap Posted April 26, 2021 Author Posted April 26, 2021 The above solution does not appear be working for php custom blocks. Anyone knows how to include a php file in a custom php block?
Nathan Explosion Posted April 26, 2021 Posted April 26, 2021 Sorry, glossed over the custom php block element. This works fine - file in root of IPS installation: include("test.php"); echo $test; file in folder within the IPS installation: include("foldername/test.php"); echo $test; file in folder a level above the IPS installation: include("../test.php"); echo $test; Content of the test.php file: <?php $test = "BLAH!!!"; return $test; ?> Adlago 1
virap Posted April 26, 2021 Author Posted April 26, 2021 Thank you so much. After I put the quotation marks it works.
Recommended Posts