//********************************* //* preliminary stuff //********************************* error_reporting(E_ALL); include('PhpFunctions.php'); //********************************* //* main processing //********************************* $SpamDetected = FALSE; $MagicNum = $_POST['MagicNum']; if ($MagicNum != "1963") { $SpamDetected = TRUE; } if (stristr($_POST['EmailAddr'], "cc:") != FALSE) { $SpamDetected = TRUE; } if (stristr($_POST['EmailAddr'], "subject:") != FALSE) { $SpamDetected = TRUE; } if (stristr($_POST['CommentsAndQuestions'], "http:") != FALSE) { $SpamDetected = TRUE; } if (stristr($_POST['CommentsAndQuestions'], "href") != FALSE) { $SpamDetected = TRUE; } $PhotoNum = 0; while ($PhotoNum < 5) { $PhotoName = CleanString($_POST[PhotoName][$PhotoNum]); if (stristr($PhotoName, "viagra") != FALSE) { $SpamDetected = TRUE; } if (stristr($PhotoName, "[url") != FALSE) { $SpamDetected = TRUE; } $PhotoNum++; } if ($SpamDetected == TRUE) { echo "STOCK PHOTO ORDER REJECTED


\n"; exit(); } $_POST['EmailAddr'] = preg_replace("/\r/", "", $_POST['EmailAddr']); // Remove \r and \n characters so spammers can't hijack the headers. $_POST['EmailAddr'] = preg_replace("/\n/", "", $_POST['EmailAddr']); $EmailAddr = $_POST['EmailAddr']; $RequestersName = $_POST['RequestersName']; $Msg = "Stock Photo Order received"; if ($RequestersName != "") { $Msg .= " from "; $Msg .= $RequestersName; $Msg .= " ("; $Msg .= $EmailAddr; $Msg .= ")"; } $Msg .= " on "; $Msg .= date("F j, Y.\r\n\r\n"); $Msg .= "Publication type: "; $Msg .= $_POST['PublicationType']; $Msg .= "\r\n\r\nSize of print run: "; if (isset($_POST['SizeOfPrintRun'])) { $Msg .= $_POST['SizeOfPrintRun']; } else { $Msg .= "unspecified."; } $Msg .= "\r\n\r\nExclusivity: "; $Msg .= $_POST['Exclusivity']; $Msg .= "\r\n\r\nNumber of uses: "; $Msg .= $_POST['NumberOfUses']; $Msg .= "\r\n\r\nRequested photos:\r\n\r\n"; $PhotoNum = 0; while ($PhotoNum < 5) { $PhotoName = CleanString($_POST[PhotoName][$PhotoNum]); if ($PhotoName != "") { $PhotoWidth = CleanString($_POST[PhotoWidth] [$PhotoNum]); $PhotoHeight = CleanString($_POST[PhotoHeight] [$PhotoNum]); $PhotoSizeUnits = CleanString($_POST[PhotoSizeUnits][$PhotoNum]); $PhotoLocation = CleanString($_POST[PhotoLocation] [$PhotoNum]); $Msg .= $PhotoName; $Msg .= ' '; if ($PhotoWidth != "") { $Msg .= $PhotoWidth; if ($PhotoHeight != "") { $Msg .= ' x '; } } if ($PhotoHeight != "") { $Msg .= $PhotoHeight; } if ($PhotoWidth != "" || $PhotoHeight != "") { $Msg .= ' '; $Msg .= $PhotoSizeUnits; } $Msg .= ' ('; $Msg .= $PhotoLocation; $Msg .= ")\r\n\r\n"; } $PhotoNum++; } if (isset($_POST['CommentsAndQuestions'])) { $Msg .= "\r\n\r\nComments and questions:\r\n\r\n"; $Msg .= $_POST['CommentsAndQuestions']; } $Msg .= "\r\n\r\n\r\nI'll contact you soon to confirm details of pricing and discuss any other outstanding issues.\r\n\r\n"; $Msg .= "regards,\r\n\r\n"; $Msg .= "Richard Seaman.\r\n\r\n"; $CustomerEmailHeaders = "From: richard@richard-seaman.com\r\n"; $CustomerEmailHeaders .= "Return-Path: z0282@yahoo.com\r\n"; $CustomerEmailResult = mail($EmailAddr, "stock photo order", $Msg, $CustomerEmailHeaders); $MyEmailHeaders = "From: " . $EmailAddr . "\r\n"; $MyEmailHeaders .= "Return-Path: payments@richard-seaman.com" . "\r\n"; $YahooMsg = $Msg . "\r\n\r\n(order received from " . $EmailAddr . ")\r\n"; $MyEmailResult = mail("z0282@yahoo.com", "stock photo order received", $YahooMsg, $MyEmailHeaders); $MyEmailResult = mail("richard@richard-seaman.com", "stock photo order", $Msg, $MyEmailHeaders); if ($MyEmailResult == TRUE) { echo "STOCK PHOTO ORDER SUCCESSFULLY ENTERED


\n"; echo "\n"; echo "Your stock photo order has been entered into the system, you should receive a confirmation email within 24 hours.

\n"; echo "
\n"; echo "\n"; echo "If it doesn't arrive then check your junk mail folder, they occasionally end up there.

\n"; echo "
\n"; echo "\n"; echo "If you don't receive the confirmation, then send an email to me at:
\n"; echo "
\n"; echo "

\n"; } else { echo "STOCK PHOTO ORDER FAILED


\n"; echo "\n"; echo "There was a problem with your stock photo order.

\n"; echo "Please return to the order form and try again, or email the order to me at:

\n"; echo "
\n"; echo "

\n"; } ?>