Hello, I am a newbie coder and I am trying to create a php mailing list.
I would like the users to enter their email address into the text box
and click submit and have the email addresses seperated by ;'s and
imported into my list.txt file.
Here is the code I found that I am currently using.
<?php
$email = $_POST['email'];
$data = "list.txt";
$open = fopen($data, "a");
fwrite($open, $email . "\n" );
fclose($open);
echo '<form style="visibility:hidden" action="http://www.stukface.com" method="post" name="theForm" id="theForm"><input type="hidden" name="NextPage" value=""> <input name="email" type="text" value="' . $_POST['email'] . '"><input type="submit" name="Submit22" value="submit" alt="submit"></form>';
echo '<SCRIPT LANGUAGE="JavaScript"> javascript:document.forms[0].submit() </script>'
?>
The redirect isn't working correctly. Does anyone know what is wrong?
I am also interested in knowing if there could be a way to validate the email so that it is in proper email form ie 123@acb.com.
Thank you very much.