If you try to put this in your file
include(ABSPATH.'yourfile.php');
functionname1();
some php command referring to function();
functionname2();
some php commands referring to function();
assuming that 'yourfile.php' is something like:
function functionname_1() {}
function functionname_2() {}
...you get error messages or something breaks down in different views.
You are probably tired of reading those mysqli error codes, too.
You can save yourself a lot of heartache by following the advice in the readme of the Exec-Php plugin.
They say
As a general rule I would advise to separate all definitions into a file and reference to it by calling require_once(). So the above example would be split into two parts, your article and a file.Then, you new post or page looks like
require_once(ABSPATH.'yourfile.php');
functionname_fixed();
And, in 'yourfile.php', you have something like:
function functionname_fixed() {
stuff previously included in functionname1();
stuff previously included in functionname2();
echo stuff;
}

No comments:
Post a Comment