简体   繁体   中英

How to include an external PHP file into a Joomla article?

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.

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

I have tried the following:

  • 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"; ?> <?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?

Try 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

Using extensions is the only way to do that.
If you don't want to use a plugin that allows PHP into articles, you would have to write your own custom component to show that php page in your own menu item, out of an article.

如果你没有说过你是想在一篇特定的文章中做过这一次,或者你希望能够将它放入任何文章中,那么有点难以回答。

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