Email submission php to the max
Posted: Wed Jun 18, 2008 6:18 am
I know almost nothing about php (and only a small amount of html), but I'm making a website for my band (not that we'll be taking over the world any time soon), and need to use php for some things.
While the site is "under construction", I want to have a page up that allows visitors to input their email address so that I can email them when it is done, and also when we upload a new song etc etc.
I've called the page "index.htm" (because it'll be the main page up until the rest is done). In index.htm I have this:
at the start of the input box. I don't know if this is right...
Then for "email.php" I have:
I don't know what's going on really, just robbed it from various tutorials.
How do I assign the variable "$new_email" to the email address that has just been entered? So when someone enters their email I want it to equal $new_email.
Also are email.php and index.htm even right?
Any help is very much appreciated
While the site is "under construction", I want to have a page up that allows visitors to input their email address so that I can email them when it is done, and also when we upload a new song etc etc.
I've called the page "index.htm" (because it'll be the main page up until the rest is done). In index.htm I have this:
Code: Select all
<form action="email.php" method="post"></form>Then for "email.php" I have:
Code: Select all
<?php
$email_list = ("email.txt");
$emails = file($email_list);
$fp = fopen($email_list , "a");
fputs($fp , "$new_email");
fclose($fp);
?>How do I assign the variable "$new_email" to the email address that has just been entered? So when someone enters their email I want it to equal $new_email.
Also are email.php and index.htm even right?
Any help is very much appreciated