Hello,
We have started a cards site. I have a problem which i have not been
able to solve. When someone opens a card sent to him, an email is
sent to the sender saying that, his card has been seen.
To send this email, we put a php3 code(given below) in the page where the card is
opened by the recipient.
The problem is, whenever the card page is opened again or even refreshed,
an email is again sent to the sender saying his card was seen.
I want to alter this code, so that no matter how many times
the card page is opened or seen, an email is sent only the first time the page is opened.
I hope you are getting me.
I am not very well versed with php3, so if you give me the proper code and
tell me where to place it, it will be great.
Thank you,
Aditya
This code is put at the end of the page, so whenever the page opens,
an email is sent out. This email should be sent only once- that is the
first time, the page opens.
/##################### JUST BEEN SEEN MAILER ##############/
$mailfrom="SpreadJoy.com";
$fromadd="director@spreadjoy.com";
$fromA="$mailfrom<$fromadd>";
$mailprog = '/usr/sbin/sendmail -t';
$fd = popen($mailprog, "w");
fputs($fd, "To: $email\n");
fputs($fd, "From: $fromA\n");
fputs($fd, "Subject: $resp_name1 has just seen your card! \n\n");
fputs($fd, "Hello $name, \n\n");
fputs($fd, "$resp_name1 has just seen the card you had sent.\n\n");
fputs($fd, "Your card url - $url\n\n");
fputs($fd, "Regards,\n\n");
fputs($fd, "www.spreadjoy.com\n");
fputs($fd, "Cards with Class!\n\n");
pclose($fd);
?>