Creating a Mailing List (PHP)
<p>I have a website where I have two text boxes for information entry. My "Submit" Button orders a PHP file to take the information in the two text boxes and copy/paste it into a text file named "Members.txt" The purpose is to take the information from the text boxes and create a mailing list. Now my problem is that I know the PHP file is calling for the text file because each time I hit submit, i can see on my ftp that the text file has been edited at the same time I try to submit to be apart of the list. In additon, the text file Is attempting to place the information into the text file as I can see that every time the "Submit" button is hit, the Text files entry lines are lower and lower. In otherwords a complete line is entered. but no text. And no, the text is not white. What am I doing wrong?</p>

<pre><code>&lt;h2&gt;Join our Mailing List&lt;/h2&gt;
   &lt;form method="post" action="add.php" name="signup"&gt;
   &lt;input type="hidden" name="pommo_signup" value="true" /&gt;
   &lt;table border="0" bordercolor="#000000"
    bordercolordark="#000000" bordercolorlight="#000000"&gt;
     &lt;tr&gt;
       &lt;td width="203" bgcolor="#FFFFFF"&gt;&amp;nbsp;&lt;/td&gt;
       &lt;/tr&gt;
     &lt;tr&gt;
       &lt;td bgcolor="#FFFFFF"&gt; NAME:  &lt;font size="4"&gt;
         &lt;input name="name"
            type="text" size="20" maxlength="100" /&gt;
       &lt;/font&gt;&lt;/td&gt;
       &lt;/tr&gt;
     &lt;tr&gt;
       &lt;td height="26" bgcolor="#FFFFFF"&gt; EMAIL: &lt;font size="4"&gt;
         &lt;input name="email"
            type="text" size="20" maxlength="100" /&gt;
         &lt;/font&gt;&lt;/td&gt;
       &lt;/tr&gt;
     &lt;tr&gt;
       &lt;td height="31" bgcolor="#FFFFFF"&gt;&lt;span style="text-align: left"&gt;&lt;/span&gt;&lt;p align="middle"&gt;
         &lt;input type="image" src="ok.jpg" /&gt;
       &lt;/p&gt;&lt;/td&gt;
       &lt;/tr&gt;
     &lt;/table&gt;
   &lt;/form&gt;

THEN BELOW IS THE FORM THAT IS SUPPOSED TO ADD TO THE TEXT BOX.

&lt;?php
$filename = "members.txt";
$fd = fopen ($filename, "r");
$contents = fread ($fd, filesize ($filename));
fclose ($fd);
if(strstr($contents,$email)) { 
print "You're already subscribed to this mailing list.";
}
else {
echo "Thank you $email for joining the mailing list";
if (!$save = fopen("members.txt","a")) {
exit;
}
fwrite($save,"$email\r\n");
fclose($save);
if (!$save = fopen("names.txt","a")) {
exit;
}
fwrite($save,"$name\r\n");
fclose($save);
mail("$email", "Fairview HiFi News Letter", "Welcome to the Fairview HiFi mailing list. Your exclusive source for product and promotional news and events.",
     "From: Newsletter@FairviewHiFi.com\r\n"
    ."Reply-To: NOREPLY@FairviewHiFi.com\r\n"
    ."X-Mailer: PHP/" . phpversion());
}
?&gt;
</code></pre>
