【发布时间】:2019-08-01 09:07:54
【问题描述】:
我有这个 html 文件:
<div>
<div class="input">
<img src="2017-01-10.jpg">
</div>
<div class="input">
Some text here
</div>
<div class="input">
January 10th 2017
</div>
</div>
我想制作一个输入表单(在另一个页面中),在其上方添加一个这样的 div。
因此,用户可以在表单中填写图像、文本和日期,并在提交时添加到 html 文件中的代码上方,但需要新的输入。
最后的代码是这样的:
<div>
<div class="input">
<img src="2017-01-11.jpg">
</div>
<div class="input">
Some text here
</div>
<div class="input">
January 11th 2017
</div>
</div>
<div>
<div class="input">
<img src="2017-01-10.jpg">
</div>
<div class="input">
Some text here
</div>
<div class="input">
January 10th 2017
</div>
</div>
我会在表单的 php 文件中添加什么? php可以永久写入html文件吗?
【问题讨论】:
-
您可以在数据库中插入表单数据并使用while循环在html页面中调用它
-
The manual 永远是第一个开始的地方
-
"我将在表单的 php 文件中放入什么?" — 您需要从介绍性 PHP 教程开始,而不是 Stackoverflow。 (嗯,你可以从the tag wiki开始,用它来寻找合适的教程)。
-
"php 可以永久写入 html 文件吗?" — 可能,但这是一个糟糕的主意。使用数据库。
-
感谢您的回答!我会尝试学习一些php和Mysql
标签: html