doulu1945 2012-05-02 09:28
浏览 31

PHP创建文章

I'm quite new on Joomla.

I would like to understand how to create Articles using PHP. As today I use Fabrik to collect info using form, but i need to create in authomatic way a Joomla Article based on those data.

I'm looking for a solution (if is possible) based on PHP that will be executed when user submit the form.

thanks a lot for your help.

  • 写回答

2条回答 默认 最新

  • doupo2241 2012-05-02 09:33
    关注

    You would, preferably, save the article in a database (MySQL, maybe) then you would using the form (using METHOD="POST") send the results and extract them (using $_POST['* name of input']) and then save that variable into the MySQL database.

    <form action="?article=submit" method="POST">
    <input type="text" name="title"/>
    <input type="submit"/>
    </form>
    
    <?php
    if($_GET['article'] == "submit"){
    if(!empty($_POST['title'])){
    mysql_query("INSERT INTO article (title)VALUES ('".$_POST['title']."')")or die(mysql_error());
    }
    
    }
    ?>
    
    评论

报告相同问题?

悬赏问题

  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 关于大棚监测的pcb板设计
  • ¥15 stm32开发clion时遇到的编译问题
  • ¥15 lna设计 源简并电感型共源放大器
  • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)
  • ¥15 Vue3地图和异步函数使用
  • ¥15 C++ yoloV5改写遇到的问题
  • ¥20 win11修改中文用户名路径
  • ¥15 win2012磁盘空间不足,c盘正常,d盘无法写入