我已经创建了一个网站的职业表格,我希望人们上传简历,我在邮件中收到它,我做了一些事情,我从文本框接收提交的数据并选择框但我无法收到附件,请帮我收到邮件中的附件,这里是我的表格和php代码:
<form method="post" action="careermail.php">
<table border="0">
<tr><td class="text">Name</td></tr>
<tr><td>
<input class="txtbox" type="text" name="Name" placeholder="Your Name" required="required" /></td></tr>
<tr><td class="text">Email</td></tr>
<tr><td><input class="txtbox" type="email" name="Email" placeholder="Your Email" required="required" /></td></tr>
<tr><td class="text">Role</td></tr>
<tr><td><select class="slbox" name="Role">
<option value="development">Development</option>
<option value="designing">Designing</option>
<option value="testing">Testing</option>
<option value="marketing">Marketing</option>
</select></td></tr>
<tr><td class="text">Upload your resume</td></tr>
<tr><td><input class="file" type="file" name="file" size="40"><br /></td></tr>
<tr><td style="text-align:right;"> <input class="submit" type="Submit" value="Submit" placeholder="Your Email" /></td></tr>
</table>
</form>
<script type="text/javascript">
window.alert("Thank you! We will get back to you shortly.");
window.location.replace("career.html");
</script>
<?php
// VALUES FROM THE FORM
$name = $_REQUEST['Name'];
$email = $_REQUEST['Email'];
$role = $_REQUEST['Role'];
$File = $_REQUEST['File'];
$fields = array();
$fields{"Name"} = "Name";
$fields{"Email"} = "Email";
$fields{"Role"} = "Role";
$fields{"File"} = "Message";
// CREATE THE EMAIL
$headers = "Content-Type: text/plain; charset=iso-8859-1\n";
$headers = "From: $name $email <$email>\n";
$recipient = "info@appsysinfotech.com";
$subject = "Career Form";
$message = "A message has been sent from: \n\n"; foreach($fields as $a => $b){ $message .= sprintf("%20s: %s\n",$b,$_REQUEST[$a]); }
// SEND THE EMAIL TO YOU
mail($recipient, $subject, $message, $headers);
?>