Support » Plugin: PHP Everywhere » How to include a file

  • Hi,

    I have a php file that contains various php functions and variables.

    How do I include this file in the “PHP Everywhere” editor text field ?

    In normal php you would just add this line…
    require_once(‘functions_date.php’);

    I have tried this in the “PHP Everywhere” text field but it did not work.
    I then tried…
    require_once(“functions_date.php”);
    Then tried..
    require_once((“functions_date.php”));
    in case it was needing an extra parenthesis as I noticed the example echo statements require them but still did not work.

    How can I include this file so I can use this code.

    Thank you

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Alexander Fuchs

    (@alexander_fuchs)

    Hi,

    the normal PHP syntax should work. Your problem might be your hosting provider blocking the usage of require in a PHP eval() command.

    Best regards,

    Alexander Fuchs

    Thanks Alexander. It was just me being dumb. I got the wife to check my code and she pointed out where I had gone wrong. 🙂

    There is one other question I would like to ask. That is the pre tags that are put around the code on the rendered page. Is there a way to remove them or does the plugin actually need them?
    It’s just that on the theme I am using (not tried any others) the pre tags put an unsightly border around on the rendered php on the rendered page.

    Thanks again Alexander

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.