** FYI - I did look at examples here on EE and by googling and was still bit unsure on how to add it properly...
I'm not too savvy with PHP but was able to utilize this "Feedback.php" script that was available on the net. It works fine with the basic "feedback me" form I created to utilize this php file that resides on the hosting server and all responses including title of email and subject are properly sent to my email account.
What line(s) of code is needed to this script to allow a user to add an attachment to their feedback (i.e. allow them to browse their hard drive and select a file on the form) to accomplish this and what HTML code is needed to add to my form?
Any help will be very much appreciated.
// ~~~~~~~~~~~~~~ feedback.php ~~~~~~~~~~~~~~
<?
$formurl = "
http://www.MySite.com/feedback.html" ;
$errorurl = "
http://www.MySite.com/error.html" ;
$thankyouurl = "
http://www.MySite.com/thankyou.html" ;
// -------------------- END OF CONFIGURABLE SECTION ---------------
$name = $_POST['name'] ;
$email = $_POST['email'] ;
$comments = $_POST['comments'] ;
$http_referrer = getenv( "HTTP_REFERER" );
if (!isset($_POST['email'])) {
header( "Location: $formurl" );
exit ;
}
if (empty($name) || empty($email) || empty($comments)) {
header( "Location: $errorurl" );
exit ;
}
$name = strtok( $name, "\r\n" );
$email = strtok( $email, "\r\n" );
if (get_magic_quotes_gpc()) {
$comments = stripslashes( $comments );
}
$messageproper =
"This message was sent from:\n" .
"$http_referrer\n" .
"-------------------------
COMMENTS -------------------------\
n\n" .
$comments .
"\n\n---------------------
----------
----------
----------
---------\
n" ;
mail($mailto, $subject, $messageproper, "From: \"$name\" <$email>\r\nReply-To: \"$name\" <$email>\r\nX
-Mailer: chfeedback.php 2.04" );
header( "Location: $thankyouurl" );
exit ;
?>
// ~~~~~~~~~~~~~~ feedback.htm ~~~~~~~~~~~~~~
<html>
<head>
<title></title>
</head>
<body>
<form action="feedback.php" method="post">
<table border="0" cellpadding="8" cellspacing="8" scrolling="no" summary="feedback form">
<tr>
<td>Your Name or Company:</td>
<td><input type="text" name="name" size="32" /></td>
</tr>
<tr>
<td>Your Email address:</td>
<td><input type="text" name="email" size="32" /></td>
</tr>
<tr>
<td colspan="2">Comments<br />
<textarea rows="12" cols="52" name="comments">
</textarea> </td>
</tr>
<tr>
<td align="center" colspan="2"><input type="submit" value="Send Feedback" /> <br/> </td>
</tr>
</table>
</form>
</body>
</html>