Quote:
Originally posted by sexyavs
brujah,
I remember someone asked you about a 4 lines of php code that will allow users to submit their email address and save it to a file or soemthing?
You still have that?
|
Make a form like this one
<form action="collect.php" method="post">
<input type="text" name="email"><br />
<input type="submit" value="Subscribe">
</form>
Then a php file named collect.php like this:
Code:
<?php
if ( eregi( '^[-!#$%&\\'*+\\./0-9=?A-Z^_`a-z{|}~]+@[-!#$%&\\'*+\\/0-9=?A-Z^_`a-z{|}~]+\.[-!#$%&\\'*+\\./0-9=?A-Z^_`a-z{|}~]+$', $email ) )
{
$fp=fopen('email.txt','a+');
if($fp) {
fwrite($fp,"$email\n");
fclose($fp);
}
}
?>
You'll need a file like 'email.txt' with permission to write to it.
There isn't a lot of validation, but it'll log all the email addresses being entered.