I am using a form on my web site for customer support
<?php
require_once "../cmsAdmin/lib/init.php";
// process form
if (@$_REQUEST['submitForm']) {
// error checking
$errorsAndAlerts = "";
if ([url "mailto:!@$_REQUEST['fullname'"]!@$_REQUEST['fullname'[/url]]) { $errorsAndAlerts .= "You must enter your full name!<br/>\n"; }
if ([url "mailto:!@$_REQUEST['email'"]!@$_REQUEST['email'[/url]]) { $errorsAndAlerts .= "You must enter your email!<br/>\n"; }
else if(!isValidEmail(@$_REQUEST['email'])) { $errorsAndAlerts .= "Please enter a valid email (example:
user@example.com)<br/>\n"; }
if ([url "mailto:!@$_REQUEST['message'"]!@$_REQUEST['message'[/url]]) { $errorsAndAlerts .= "You must enter a message!<br/>\n"; }
// send email user
if (!$errorsAndAlerts) {
$from = $_REQUEST['email'];
$to = "
test@test.com";
$subject = "Email form submitted from {$_SERVER['HTTP_HOST']}";
$message = <<<__TEXT__
You've received an email from the email form here:
[url "http://{$_SERVER['HTTP_HOST']}{$_SERVER['SCRIPT_NAME'"]http://{$_SERVER['HTTP_HOST']}{$_SERVER['SCRIPT_NAME'[/url]]}
Full name: {$_REQUEST['fullname']}
Email: {$_REQUEST['email']}
Message: {$_REQUEST['message']}
The user who sent this message had the IP address {$_SERVER['REMOTE_ADDR']}.
__TEXT__;
// Note: The above line must be flush left or you'll get an error
// This is a PHP heredoc. See:
http://ca2.php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc // send message
$mailResult = @mail($to, $subject, $message, "From: $from");
if (!$mailResult) { die("Mail Error: $php_errormsg"); }
//
$errorsAndAlerts = "Thank you for contacting Axis Lighting. We will do our best to get back to you as quickly as possible.";
$_REQUEST = array(); // clear form values
}
}
?>
My question is can I make it have a field to upload an attachment as well?