简体   繁体   中英

Including a php file in Joomla! 1.5 that calls another php file

I would like to include a PHP program into a Joomla! article, this program calls different PHP files that are used to display what I want, I have tried to install different Plugins such as Jumi, directPHP and others, but I keep getting the following error:

Application raised an exception class EDatabaseError with message 'Cannot connect to database server:mysql error: [0: Connection error to server '' with user ''] in CONNECT(, '', ' * *', ) '

The program runs fine Standalone, however it does not work when I'm running it on Joomla.

The connection parameters are obtained from an include "config.php" but it seems that they won't get the includes from the included PHP file.

Also when I try to include a menu I have made, which works standalone, redirects me to the index.php of Joomla! root dir.

Thanks.

I've done things similar to this, but have had to install a couple of extensions to get them to work.

First, i use the jce WYSIWYG. then installed place anywhere (which lets you place modules inside articles) create a new module, type=Custom HTML code your php there...

I know this isn't exactly what you're describing, but it's the closest i've come in my experience.

If it doesn't work right away, be sure to check for the settings withing the JCE WYSIWYG so it's not breaking your php.

hope this helps!

Try to use 'Flexi Custom Code' extension is a good one check it: http://extensions.joomla.org/extensions/core-enhancements/coding-a-scripts-integration/custom-code-in-modules/15251

Its a module extension which you can use with 'module anywhere' to place in the 'content area'(article). For calling different php file you can use the php include or required once code

Please feel free to ask if any doubts are there....implementing this

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM