fortwilliam
Programmer
I have a newsletter system and want to have it work automatically. what I have so far works with a visitor to a page with a tiny iframe in it. This iframe calls up the send.pl newsletter script. Trouble is that if the visitor refreshes the page before the script has finished, duplicate emails are sent out. Or if they leave the page before the perl script has finished, not all emails are sent.
When the script is finished, I have it write to a text file with a year and day value so that no more emails will be sent until the next day. I tried writing to this text file at the very start of the script, but if the visitor refreshed the page, not all emails are sent.
What way could I use to have the script carry on doing its thing regardless of what the visitor to the page does. What I want is for the visitor to trigger the perl script within the iframe and that is all that is required. After that the script works away itself in the background, happily sending out the scheduled messages.
Thanks.
When the script is finished, I have it write to a text file with a year and day value so that no more emails will be sent until the next day. I tried writing to this text file at the very start of the script, but if the visitor refreshed the page, not all emails are sent.
What way could I use to have the script carry on doing its thing regardless of what the visitor to the page does. What I want is for the visitor to trigger the perl script within the iframe and that is all that is required. After that the script works away itself in the background, happily sending out the scheduled messages.
Thanks.