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?
<h2>Join our Mailing List</h2>
<form method="post" action="add.php" name="signup">
<input type="hidden" name="pommo_signup" value="true" />
<table border="0" bordercolor="#000000"
bordercolordark="#000000" bordercolorlight="#000000">
<tr>
<td width="203" bgcolor="#FFFFFF"> </td>
</tr>
<tr>
<td bgcolor="#FFFFFF"> NAME: <font size="4">
<input name="name"
type="text" size="20" maxlength="100" />
</font></td>
</tr>
<tr>
<td height="26" bgcolor="#FFFFFF"> EMAIL: <font size="4">
<input name="email"
type="text" size="20" maxlength="100" />
</font></td>
</tr>
<tr>
<td height="31" bgcolor="#FFFFFF"><span style="text-align: left"></span><p align="middle">
<input type="image" src="ok.jpg" />
</p></td>
</tr>
</table>
</form>
THEN BELOW IS THE FORM THAT IS SUPPOSED TO ADD TO THE TEXT BOX.
<?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
");
fclose($save);
if (!$save = fopen("names.txt","a")) {
exit;
}
fwrite($save,"$name
");
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
"
."Reply-To: NOREPLY@FairviewHiFi.com
"
."X-Mailer: PHP/" . phpversion());
}
?>