script executeion problem - executes twice for no reason - help
| From: | Edward Bailey | Date: | Mon, 22 Apr 2002 15:48:24 +0000 |
| Subject: | script executeion problem - executes twice for no reason - help | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-94019@lists.php.net to get a copy of this message | ||
Please excuse my ignorance, this is probably a simple
problem but I have no idea what to do next.
I wrote the following to send an automated response to
users that fill out a form, select submit and that
triggers the conditional "if" statement and then the
script sends an HTML based newsletter to the user. The
script does work, but it sends out TWO newsletters
instead of one and I have no idea why. I have used the
code below in several different forms and it does the
same thing each time so I would assume the code is the
problem.
if()
{$filename = "../includes/news.html";
$to = "$email";
$subject = "Newsletter";
$fd = fopen ($filename, 'r');
$message = fread ($fd,
fileSize("../includes/news.html"));
fclose ($fd);
$headers = "To: $email\nFrom: $from\nReply-To:
$reply_address\nMIME-Version: 1.0\nContent-type:
text/html; charset=iso-8859-1\n";
mail($to, $subject, $message, $headers);
}
Can anyone help me or point me in the right direction?
Thanks
Ed
__________________________________________________
Do You Yahoo!?
Yahoo! Games - play chess, backgammon, pool and more
http://games.yahoo.com/