", $message ) . ":" . $random . "\n";
$allcards = $oldcards . $newcard;
$idnumber=$free+1;
// If the recipient's email is correct
if (eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*$", $remail)) {
// Preview Message
echo "\n\n\n \n | \n ";
echo "\n\n";
echo "Message: " . stripslashes(nl2br(htmlentities($message))) . " | \n\n
\n
\n";
// If the sender's email is correct
if (eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*$", $semail)) {
if ($epost == "yes") { // Write to file
$cartFile = fopen("$cardfile","w");
fwrite($cartFile,$allcards);
fclose($cartFile);
// Message to be included in email
$email_message = "To pick up your card, visit
http://www.celtic-art.com/ecards/receive.php3
and enter Card Number $idnumber and Random Number $random
or
click on
http://www.celtic-art.com/ecards/receive.php3?viewcard=$idnumber&random=$random
The Message Text Follows:
" . eregi_replace("
", "\n",stripslashes($message));
// Send to recipient - Taken Out: Reply-To: $semail \r\n X-Mailer: PHP3 \r\n
mail(stripslashes($recipient) . "<$remail>", stripslashes($sender) . " has sent you a card", $email_message,"From: $semail \nReply-To:$semail\nX-Mailer: PHP3\r\n Errors-To: mike@flora.org");
// To send another card
echo "
Your card number $idnumber has been sent to " . stripslashes($recipient);
echo "
\nWould you like to send another card?
\n";
echo "
";
}
elseif ($epost == "no") {
echo "
Would you like to try again?
\n";
echo "
";
}
else {
echo "
You have not YET sent the card.
\n";
echo "
";
}
} // End of verification for $semail
else { echo "This card was NOT sent because a valid email address was not provided!\n"; }
} // End of verification for $remail
else { echo "A preview was NOT provided because a valid email address was not provided!
\n"; }
?>