Jump to content

Custom php block - include file?


Recommended Posts

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.

Screenshot 2021-04-25 082333.jpg

Edited by virap
Link to comment
Share on other sites

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;
?>

 

 

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...