Can use/include my own php file using the include ('myphpfile.php'); statement in the AS BS BE BB or any of the stored PHP procedures? I tried it and it displays it on the screen in a modal/debug window so I wondering if there is some reason that it can't.
Can I do the same thing with any JavaScript files in the Custom Code section? such as: <script type="text/javascript" src="myjavascript.js">
Or rather how can I do this in these sections?
Welcome to the nuBuilder Forums!
Register and log in to access exclusive forums and content available only to registered users.
Register and log in to access exclusive forums and content available only to registered users.
Including my own php and/or javascript files
-
- nuBuilder Team
- Posts: 4292
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 444 times
- Contact:
Re: Including my own php and/or javascript files
If myphpfile.php is in nuBuilder's root directory, include it like this:
Or include php files in nuconfig.php: ($nuConfigIncludePHP = '..\myphpfile.php';)
Code: Select all
include_once(__DIR__ . "/../myphpfile.php");
Re: Including my own php and/or javascript files
I tried taking my function and putting that in a php file. I am not putting the <php ? and ?> tags in it. Then saving it in the root of the nubuilder. Then in my After Save code Im putting: include_once(__DIR__ . "/../myphpfile.php");
It reads it, but it displays it on the screen in what looks like a modal screen, along with what looks like the $nudata array. Its what happens if I do an echo in any of the PHP in any of the SA BB BE BS code blocks. It's reading it like text, rather then processing or evaluating it like PHP.
It reads it, but it displays it on the screen in what looks like a modal screen, along with what looks like the $nudata array. Its what happens if I do an echo in any of the PHP in any of the SA BB BE BS code blocks. It's reading it like text, rather then processing or evaluating it like PHP.
Re: Including my own php and/or javascript files
I added <? php to the beginning and ?> to the end and now its working.
-
- Posts: 249
- Joined: Sun Dec 06, 2020 6:50 am
- Location: Chennai, India, Singapore