Use the second one MichaelH posted, it’s much better! =) That’s coming from experience lol! =)
spencerp
Both of these plugins (runPHP and PHPexec) will add <br /> after each line of the includes. I only know this because when I use php include to add a javascript file, all these <br />s get added and ruin the code.
When I include a PHP file, it just doesn’t work but doesn’t show up in the html code-view.
As I asked elsewhere, is there a setting for WP I can turn off?
gmdavis62, so you tried adding javascript to a “page” then, while using one of them plugins? If so, why are you doing that? Those plugins are for using “php” within a page, not javascripts.. :/
spencerp
This was supposed to be a feature of WP 2.0. (previously 1.6).
See Here:
http://codex.ww.wp.xz.cn/Version_1.6#Pages
Any one know what happened to it? I would be a nice feature to have 🙂
To claify: I was using javascript (embedded in a PHP file) as an include. PHP can include any type of file in a webpage. These plugins SHOULD be able to support this or wordpress should allow you to turn off the automatic adding of <br /> after each line.
UDATE: I just found that (for both runPHP and PHPexec) if you enclose your php in <pre> <pre> tags, WordPress won’t insert <br /> at the end of each line of the resulting html.
However, some php includes still don’t work as expected. I’m not sure yet what is happening.
If you are looking to call singular functions, or include one specific file, CG-QuickPHP is a faster method in many cases. It can make one function call with static-typed parameters (though it accepts strings, numbers, and true/false), so it can do an include(“file”) just as easily as any other function. Just FYI.
-d