简体   繁体   English

在Joomla中包括一个php文件! 1.5调用另一个php文件

[英]Including a php file in Joomla! 1.5 that calls another php file

I would like to include a PHP program into a Joomla! 我想在Joomla中包含一个PHP程序! 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: 文章中,该程序调用了用于显示我想要的内容的不同PHP文件,我尝试安装不同的插件,例如Jumi,directPHP等,但是我一直收到以下错误消息:

Application raised an exception class EDatabaseError with message 'Cannot connect to database server:mysql error: [0: Connection error to server '' with user ''] in CONNECT(, '', ' * *', ) ' 应用程序在CONNECT(,'',' * *',)'中引发异常类EDatabaseError,消息为“无法连接到数据库服务器:mysql错误:[0:与用户''到服务器''的连接错误”

The program runs fine Standalone, however it does not work when I'm running it on Joomla. 该程序可以很好地独立运行,但是当我在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. 连接参数是从include“ config.php”获得的,但是似乎它们不会从包含的PHP文件中获得include。

Also when I try to include a menu I have made, which works standalone, redirects me to the index.php of Joomla! 另外,当我尝试包含自己制作的菜单(可独立工作)时,会将我重定向到Joomla的index.php! 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. 首先,我使用jce所见即所得。 then installed place anywhere (which lets you place modules inside articles) create a new module, type=Custom HTML code your php there... 然后将其安装在任何地方(使您可以将模块放置在文章中)创建一个新模块,在其中键入= Custom HTML code php ...

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. 如果它不能立即生效,请确保使用JCE WYSIWYG检查设置,以免破坏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 尝试使用“ Flexi自定义代码”扩展是一个很好的选择: 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 对于调用不同的php文件,您可以使用php include或必需的一次代码

Please feel free to ask if any doubts are there....implementing this 请随时询问是否有任何疑问。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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