On the other hand if I take out that code, I then get the notification email but then the file no longer uploads.
This seems to be a bit of a catch 22. Any suggestions?
Did you ever figure this out? I have the same problem with my forms.
Yup, it's confirmed. A newly designed form and new table. After adding the enctype='multipart/form-data' to the General Tab, it no longer even gives me a name of the file, nor does it even send the eMail message.
so I feel better it's not just me.
<?php
$fileatt = "files/". $_POST["uploadfilevar"]; // Path to the file
$fileatt_type = "application/octet-stream"; // File Type
$fileatt_name = $_POST["uploadfilevar"];
$first = $_POST["firstvar"];
$last = $_POST["lastvar"];
$addy = $_POST["addyvar"];
$city = $_POST["cityvar"];
$state = $_POST["statevar"];
$zip = $_POST["zipvar"];
$dob = $_POST["dobvar"];
$phone = $_POST["phonevar"];
$wga = $_POST["wgavar"];
$usc = $_POST["uscvar"];
$subType = $_POST["subTypevar"];
$stitle = $_POST["stitlevar"];
$presynopsis = $_POST["synopsisvar"];
$synopsis = stripslashes($presynopsis);
$from = $_POST["e_addyvar"];
$email_from = $from; // Who the email is from
$email_subject = $_POST["subjectvar"];
$email_txt = <<<EOF
<html>
<body bgcolor="#ffffff" text="#000000">
<table align="center" bgcolor="#9999ff" border="1" cellpadding="2"
cellspacing="2" width="100%">
<tbody>
<tr align="center">
<td colspan="2" bgcolor="#9999ff" valign="top"><b>NEW SCREENPLAY
SUBMISSION<br>
</b><small>$date</small><b><br>
</b> </td>
</tr>
<tr align="right">
<td colspan="2" valign="top"><b><font color="#ff0000">$subType</font><br>
</b></td>
</tr>
<tr>
<td valign="top">Name<br>
</td>
<td valign="top">$last , $first ($dob)<br>
</td>
</tr>
<tr>
<td valign="top">Address<br>
</td>
<td valign="top">$addy<br>
</td>
</tr>
<tr>
<td valign="top">City,State,Zip<br>
</td>
<td valign="top">$city, $state . $zip<br>
</td>
</tr>
<tr>
<td valign="top">Phone<br>
</td>
<td valign="top">$phone<br>
</td>
</tr>
<tr>
<td valign="top">eMail<br>
</td>
<td valign="top">$email_from<br>
</td>
</tr>
<tr>
<td valign="top">WGA Registration No<br>
</td>
<td valign="top">$wga<br>
</td>
</tr>
<tr>
<td valign="top">US Copyright No<br>
</td>
<td valign="top">$usc<br>
</td>
</tr>
<tr>
<td valign="top">Screenplay Title<br>
</td>
<td valign="top">$stitle<br>
</td>
</tr>
<tr>
<td colspan="2" valign="top">Synopsis<br>
</td>
</tr>
<tr>
<td colspan="2" valign="top">$synopsis<br>
</td>
</tr>
</tbody>
</table>
</body>
</html>
EOF;
// Check for Demo Submission.
switch ($usc){
case "demo":
$email_to = $from;
break;
case "DEMO":
$email_to = $from;
break;
case "Demo":
$email_to = $from;
break;
default:
$email_to = "dniezby@sample.com";
}
$headers = "From: ".$email_from;
$file = fopen($fileatt,'rb');
$data = fread($file,filesize($fileatt));
fclose($file);
$semi_rand = md5(time());
$mime_boundary = "==Multipart_Boundary_x{$semi_rand}x";
$headers .= "\nMIME-Version: 1.0\n" .
"Content-Type: multipart/mixed;\n" .
" boundary=\"{$mime_boundary}\"";
$email_message .= $email_txt . "\n\n" .
"--{$mime_boundary}\n" .
"Content-Type:text/html; charset=\"iso-8859-1\"\n" .
"Content-Transfer-Encoding: 7bit\n\n" .
$email_txt . "\n\n";
$data = chunk_split(base64_encode($data));
$email_message .= "--{$mime_boundary}\n" .
"Content-Type: {$fileatt_type};\n" .
" name=\"{$fileatt_name}\"\n" .
"Content-Disposition: attachment;\n" .
" filename=\"{$fileatt_name}\"\n" .
"Content-Transfer-Encoding: base64\n\n" .
$data . "\n\n" .
"--{$mime_boundary}--\n";
$ok = @mail($email_to, $email_subject, $email_message, $headers);
unlink ($fileatt);
?>
<br><br>Post edited by: dniezby, at: 2008/01/24 20:47
<form
name="<?php echo "ChronoContact_".$rows[0]->name; ?>"
id="<?php echo "ChronoContact_".$rows[0]->name; ?>"
method="<?php echo $paramsvalues->formmethod; ?>"
action="<?php echo $actionurl; ?>"
<?php echo $rows[0]->attformtag; ?>>
I think I found the problem.
Check line 91 of chronocontact.html.php
There is no parsing of enctype.
This would explain everything.
If it's OK with you and your IT Guy I would be interested in seeing the function he created to see if we can use it to create a workaround for this problem. It's proving tricky yo diagnose because I can't replicate it on my test sites (or the live ones come to that).
Bob