简体   繁体   English

在Joomla模板中使用PHP

[英]Using PHP in Joomla Template

I'm developing a site using joomla template. 我正在使用joomla模板开发网站。 I want to create a registration form & I design it with html in a Joomla Article. 我想创建一个注册表,并在Joomla文章中使用html进行设计。 For data passing to db I have created a PHP file. 为了将数据传递给db,我创建了一个PHP文件。 But I have a problem in submitting data. 但是我在提交数据时遇到了问题。 I gave form action="php file name" & I save the PHP file in index path. 我给了表单action =“ php文件名”,然后将PHP文件保存在索引路径中。 But system is not working. 但是系统无法正常工作。 Please tell me where I need to save that PHP file & how to link my joomla article & PHP file ??? 请告诉我我需要在哪里保存该PHP文件以及如何链接我的joomla文章和PHP文件?

Create a custom file upload component and upload your php files. 创建一个自定义文件上传组件并上传您的php文件。 Create a menu item for your component and assign a PHP file to menu you want to show your registration form on and finally at front-end include PHP file in your view. 为您的组件创建一个菜单项,然后将一个PHP文件分配给要在其上显示注册表单的菜单,最后在前端将PHP文件包含在您的视图中。

Create a folder inside plugins in main directory. 在主目录中的插件内创建一个文件夹。 Name it whatever you like, lets say, "customplugin". 随便命名,说“ customplugin”。 Put your form handling file in that. 将您的表单处理文件放入其中。 Give the absolute path of this file in the form action URL. 在表单操作URL中提供此文件的绝对路径。

This should work. 这应该工作。 Also, kindly check if the form tags are coming correctly in the article. 另外,请检查表单标记是否正确出现在文章中。

As others are saying, you are actually not using the Joomla CMS properly, but anything and everything is possible... 就像其他人说的那样,您实际上没有正确使用Joomla CMS,但是一切皆有可能...

Mistakes are always forgivable, if one has the courage to admit them. 如果有勇气承认错误,总是可以原谅的。 -- Bruce Lee - 李小龙

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

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