Here's my problem.
Here is a mock form of what I want online.
http://www.babysunshine.net/test.htm
Obviously, I want to attach a file to the results of the form and have it e-mailed to me.
The problems I am having are:
(1) The page that comes up upon hitting submit should be http://www.babysunshine.net/thankyou.html instead it comes up as http://www.babysunshine.net/baygirl@optonline.net
(2) e-mails received look as such;
--FTG_BOUNDRY
Test: HPT
Result: Positive
Brand: 1
DPO: 2
Text: 333
Attached:
2005-03-08 18:07:55
--FTG_BOUNDRY--
There isn't a file attached or even a name listed for a file!
OK.. here is my PHP code and you can see my html code off the page
<?PHP
error_reporting(7);
RegisterGlobals OFF
$FTGTest = $POST['Test'];
$FTGResult = $POST['Result'];
$FTGBrand = $POST['Brand'];
$FTGDPO = $POST['DPO'];
$FTGText = $POST['Text'];
$FTGAttached = $FILES['Attached']['name'];
$FTGSubmit = $POST['Submit'];
$FTGReset = $POST['Reset'];
Redirect user to the error page
if ($validationFailed == true) {
header("Location: error.html");
exit;
}
Email to Form Owner
$emailTo = 'baygirl@optonline.net';
$emailSubject = "POAS Submission";
$emailBody = "--FTG_BOUNDRY\n"
. "Test: $FTGTest\n"
. "Result: $FTGResult\n"
. "Brand: $FTGBrand\n"
. "DPO: $FTGDPO\n"
. "Text: $FTGText\n"
. "Attached: $FTGAttached\n"
. "" . date('Y-m-d H:i:s') . "\n"
. ""
. "\n";
if (file_exists($_FILES['Attached']['tmp_name']) === true) {
$fileName = $_FILES['Attached']['tmp_name'];
$fileHandle = fopen($fileName, 'r');
$fileAttach = fread($fileHandle, filesize ($fileName));
fclose($fileHandle);
$fileAttach = chunk_split(base64_encode($fileAttach));
$emailBody .= "--FTG_BOUNDRY\n"
. "Content-Type: " . $FILES['Attached']['type'] . "; name=\"" . $FILES['Attached']['name'] . "\"\n"
. "Content-disposition: attachment\n"
. "Content-transfer-encoding: base64\n"
. "\n"
. "$fileAttach\n"
. "\n";
}
$emailBody .= "--FTG_BOUNDRY--\n";
mail($emailTo, $emailSubject, $emailBody, $emailHeader);
Redirect user to success page
header("Location: success.html");
exit;
End of PHP script
?>
[/i]
PLEASE HELP ME!!!!!!! Thanks in advance!