【发布时间】:2015-09-06 05:02:41
【问题描述】:
我想在用户登录并发布内容时自动创建一个新的 html 页面(就像有人在 stackoverflow 中发布问题时创建的那样)。我该怎么做?
【问题讨论】:
标签: php html web content-management-system
我想在用户登录并发布内容时自动创建一个新的 html 页面(就像有人在 stackoverflow 中发布问题时创建的那样)。我该怎么做?
【问题讨论】:
标签: php html web content-management-system
你需要学习的是:
要开始使用,请学习如何在 mysql 中创建 database 和 tables。 在那之后你我必须学习如何insert your information into a database with php. 您可能还希望人们registrer themself and login.
最后,您需要通过 id 从数据库中获取内容并将其打印到您的 php 文件中。这可以通过向您的 url 添加一个变量来完成。
例子:
localhost/index.php?post=1
现在您可以使用 $_GET["id"] 获取您的“帖子 ID”或其他内容
【讨论】:
生成 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");
【讨论】: