ok, i haven't been doing php for very long, but i know how to get php form e-mails working perfectly well, until it comes to the allowing a user to attach a file and send it to a designated e-mail address.
I have a simple page which inlcudes a "browse" button used to locate a file on the computers hd, and two fields for sender and comments.
Now, i can get the form working, but i need to know exactly how to get the script to attach the file to the db and to send it to say my e-mail address without it coming up as the file name.
What exactly do i have to add to the code in order for the php to acknowledge and send it?
This is what the simple php file looks like.
<?
echo "Thankyou for your submission. It shall be uploaded to the site soon.";
?>
<br>
<?
if ($_POST) {
mail("sot_wolf@yahoo.com", "shots", "file: " . $fileup . "\r\nsubmitted by: " . $submittedby . "\r\ncomments: " . $comment);
}
?>
This is what the html form looks like
<form method="post" action="submit2.php?a=add" ENCTYPE="multipart/form-data">
<input type="hidden" name="MAX_FILE_SIZE" value="5000000">
<table border="0" cellspacing="0" cellpadding="4" class="maintext">
<tr><td valign="top">Screenshot:</td><td><input name="fileup" type="file" value=""> </td></tr>
<tr>
<td valign="top">Submitted by:</td>
<td>
<input type="text" name="submittedby" value="">
</td>
</tr>
<tr>
<td valign="top">Comments:</td>
<td>
<textarea name="comment" rows="4" cols="40" class="textbox"></textarea>
</td>
</tr>
<tr>
<td colspan="2">
<div align="center">
<input type="submit" value="Upload">
<input type="button" border="0" onClick="history.back()" value="Cancel"></div>
</td>
</tr>
</table>
</form>
Hope you can help, thx