How to include external files in php

Dear Sirs,

I have recently purchased your ExeOutput for PHP software. I am having a problem now. I am trying to include MPDF library by storing all the folders and the files of MPDF54 library as external files. I want to use include(“MPDF54/mpdf.php”) but how to use this in the php script, how to specify the storage location path for the path to mpdf.php. Here is my source code :

<?php $storagelocation = exo_getglobalvariable('HEPubTempPath', ''); //or //$storagelocation = exo_getglobalvariable('HEPubStorageLocation', ''); $includefile = $storagelocation."MDF54\mpdf.php"; include($includefile); ?>

please correct, if inappropriate. It gives me errors of file or directory not found. Kindly reply soon.


Kandarp Mistry.

If I understand, you want to keep some PHP files external?

The idea is to place your external PHP files in the “Data” subfolder and then you can access them with $_SERVER’DOCUMENT_ROOT’].
For instance, if we put an include1.php file in the “Data” subfolder, PHP can access it if you pass the full path thanks to:

More about the “Data” subfolder:

You can also see the general demonstration: it shows you a working example.