here is what part of my form looks like:
<input type="submit" name="submit" value="submit"> <input type="reset" value="reset">
<input type="file" name="attachment">
And here is what my php code is like:
<?PHP function show_form($fname="",$lname="",$company="",$streetaddress="",$city="",$state="",$zip="",$workphone="",$emailaddress="",$subject="",$comments="") { ?>
<?PHP } if (!isset($subject) or !isset($comments)) {
show_form();
}
else {
if (empty($emailaddress) || empty($fname) || empty($lname) || empty($subject) || empty($comments)) {
echo "<h2>Please fill in the required fields.</h2>";
if (empty($subject)) {
echo "The subject is empty.<br />";
}
if (empty($comments)) {
echo "Did you forget to write your message?<br />";
}
show_form($fname,$lname,$company,$streetaddress,$city,$state,$zip,$workphone,$emailaddress,$subject,$comments);
}
else {
$message = "Name: $fname $lname\nCompany: $company\nStreet Adress: $streetaddress\nCity: $city\nState: $state\nZip: $zip\nWork Phone: $workphone\nEmail: $emailaddress\nSubject: $subject\nMessage: $comments\n";
if (empty($subject)) {
$subject="Feedback Form";
}$sent = mail( "xxxx@xxxxxxx.com",
$subject,$message, "From: $fname $lname <$email>" );
if ($sent) {
echo "<b>$fname $lname</b>, your message has been sent regarding <b>$subject</b>.
<p>A response will be sent to <b>$emailaddress</b>.";
}
else {
echo "<h2>There seems to be a problem, your mail was not sent.</h2>";
}
}
}
?>
I tried sooooo many different ways to have it attach to a file (any files, besides just text) Please anyone?