PHP提交到txt文件

时间:2018-06-09 01:14:25

标签: php

我的页面上有一个订阅选项。我想要的只是让用户能够通过电子邮件订阅并将他们的电子邮件保存到.txt文件。

这是我的HTML表单代码:

<form action="contacts.php" method="post">
 E-mail: <input type="text" name="email" placeholder="Subscribe to our page for the latest News & Updates">
 <input type="submit" value="Subscribe">
</form>

我只需要知道要在contacts.php文件中写入的脚本来保存电子邮件。

我使用XAMPP作为本地服务器。

1 个答案:

答案 0 :(得分:1)

您的表格

a = range(1, 8)

contacts.php

中使用此代码
<form action="contacts.php" method="post">
<input type="text" name="email" placeholder="Subscribe to our page for the latest News & Updates" />
<input type="submit" value="Subscribe" />
</form>