Jump to content

Recommended Posts

Posted (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.

Screenshot 2021-04-25 082333.jpg

Edited by virap
Posted

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?

Posted

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

 

 

  • Recently Browsing   0 members

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