我的页面上有一个订阅选项。我想要的只是让用户能够通过电子邮件订阅并将他们的电子邮件保存到.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作为本地服务器。
答案 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>