【问题标题】:Creating pages automatically自动创建页面
【发布时间】:2015-09-06 05:02:41
【问题描述】:

我想在用户登录并发布内容时自动创建一个新的 html 页面(就像有人在 stackoverflow 中发布问题时创建的那样)。我该怎么做?

【问题讨论】:

    标签: php html web content-management-system


    【解决方案1】:

    你需要学习的是:

    • php
    • mysql

    要开始使用,请学习如何在 mysql 中创建 databasetables。 在那之后你我必须学习如何insert your information into a database with php. 您可能还希望人们registrer themself and login.

    最后,您需要通过 id 从数据库中获取内容并将其打印到您的 php 文件中。这可以通过向您的 url 添加一个变量来完成。

    例子:

    localhost/index.php?post=1

    现在您可以使用 $_GET["id"] 获取您的“帖子 ID”或其他内容

    【讨论】:

      【解决方案2】:

      生成 HTML 页面:

        $filename = 'test.html';
        header("Cache-Control: public");
        header("Content-Description: File Transfer");
        header("Content-Disposition: attachment; filename=$filename");
        header("Content-Type: application/octet-stream; ");
        header("Content-Transfer-Encoding: binary");
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2010-11-14
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2015-01-25
        • 1970-01-01
        • 1970-01-01
        • 2013-01-29
        相关资源
        最近更新 更多