如何在Joomla文章中包含外部PHP文件? [英] How to include an external PHP file into a Joomla article?

查看:158
本文介绍了如何在Joomla文章中包含外部PHP文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,基本上,我只有一篇文章希望将PHP文件加载到其中.这个PHP文件包含一堆PHP和Javascript以及HTML.

So basically, I have a single article that I would like to load a PHP file into. This PHP file has a bunch of PHP and Javascript, along with HTML.

我需要将此完整的PHP文件包含在我的文章中,因为它包含了我网站上所需的申请表.

I need to include this full PHP file into my article since it contains an application form that I need on my website.

我尝试了以下操作:

  • 使用扩展名允许文章中包含PHP和Javascript代码.虽然,这非常耗时,因为所有PHP和Javascript必须包装在一些特殊标签中才能使扩展程序识别它,因此这将花费我几天的时间.
  • 我尝试使用扩展名,然后在特殊标记中尝试<?php include "form.php"; ?>,尽管这返回了一个主要错误,因为我认为这是因为PHP代码不在标记本身之内.
  • Using an extension to allow PHP and Javascript code within an article. Although, this is extremely time consuming since all PHP and Javascript must be wrapped in some special tags for the extension to recognise it, therefore this would take me days.
  • I tried using the extension and then trying <?php include "form.php"; ?> within the special tags, although this returned a major error since I believe it is because the PHP code is not within the tags itself.

有人对我如何做到这一点有什么建议吗?

Does anyone have any suggestions to how I can accomplish this?

推荐答案

尝试一下,

创建一个包含表单的模块.对于模块开发教程

Create a module that have your forms. For module development tutorial

创建一个文章,并在其中设置模块.

And create an article and set the module inside that like.

{loadposition contact_form_pos}

在您的文章中,只需提及上面的模块位置 对于更多

Inside your article just mention the module position like above for more

这篇关于如何在Joomla文章中包含外部PHP文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆