that didnt work...
if you would like to check out the page it is at..
http://tuna.port-aransas.k12.tx.us/~brooks/con/
the code on index.php is...
<pre>
<table>
<form action="send_email.php" method="POST">
<tr>
<td>
From:<br></td><td><input type="text" size=22 name="from">
</td>
</tr>
<tr>
<td>
Subject:</td><td><input type="text" size=22 name="subject" value="TEST">
</td>
</tr>
</table>
<input type="checkbox" name="php_script_list" value="yes"> Yes, add me to
your email
list
<br>
<br>
Comments:
<br>
<textarea rows="6" cols="60" name="comments"></textarea>
<br>
<input type="submit" name="B1" value="Submit">
<input type="reset" name="B2" value="Reset">
</form>
and the source for send_mail.php is...
<?
if ($php_script_list == "yes")
{
if(eregi("([[:alnum:].-]+)(@[[:alnum:].-]+.+)", $from))
{
if(file_exists("email_list.txt"))
{
$newfile = fopen("email_list.txt", "r");
while(!feof($newfile))
{
$duplicate = fgetss($newfile, 255);
// is email address submitted already on file?
if(eregi("$from", $duplicate))
{
print("This email $from");
print(" is already in the database. Please go back");
print(" and uncheck the mail list box");
fclose($newfile);
exit;
}
}
fclose($newfile);
$addemail = fopen("email_list.txt", "a");
fputs($addemail, "$from\n");
fclose($addemail);
}
else
{
// since file doesn't already exist, let's create for first time
$newfile = fopen("email_list.txt", "a");
fputs($newfile, "$from\n");
fclose($newfile);
chmod("email_list.txt", 0666);
}
}
}
any help would be greatly appreciated. Thanks..
-BS