Jump to content

need help to add attachments to html email form


yuenrw

Recommended Posts

Hello,

Ive got a working comments/guestbook form on a site that I have created.

The html form sends the visitors name, email, and comments to my email via php.

Now I want another html form to do the same thing, only this time I want them to be able to

attach their resume (probably docs or pdfs). I have the form object that can browse from the users cpu,

but I having trouble getting the php to work.

 

here is my html:

<html>

<head>

<title>Salon Yorya Online Application Submission</title>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<style type="text/css">

<!--

body,td,th {

color: #000000;

font-family: Verdana;

font-size: 12px;

}

body {

background-color: #00ccff;

}

-->

</style></head>

 

<body><img src="images/yorya_logo.png">

<table width="474" border="0" align="left">

<tr>

<td width="468" background="images/flourish.png"><FORM METHOD="post" action="mail_careers.php">

<input type="hidden" name="to" value="[email protected]">

<INPUT TYPE="hidden" NAME="addendum" VALUE="Thank you! You may close this window to return to Salon Yorya">

<input type="hidden" name="subject" value="Email From Salon Yorya Website">

<p>Please fill out the form below and click on the <b>'Submit'</b>

button<br>

<!-- BUILD THE FORM -->

</p>

<hr>

 

 

<p align="left">Name:<br>

<input name="name" type="text" size="50" maxlength="100">

</p>

<p align="left">E-mail:<br>

<input name="email" type="text" size="50" maxlength="100">

</p>

 

<p align="left">Additional Comments: <br>

<textarea name="message" cols="50" rows="4" wrap="VIRTUAL"></textarea>

</p>

<p>Please attach your resume.<br>Attachment: <input name="path" maxlength="50" allow="text/*" type="file"></p>

 

<input type="SUBMIT" value="Submit" name="SUBMIT">

<input type="RESET" value="Reset" name="RESET">

</form></td>

</tr>

</table>

</body>

</html>

 

This is my php code:

 

<html>

 

<body>

<script type="text/javascript">document.location.href='http://www.jamescrewscompany.com/salonyorya/yorya_careers.html'</script>

 

<?php

if (isset($_REQUEST['email']))

//if "email" is filled out, send email

{

//send email

$email = $_REQUEST['email'] ;

$subject = $_REQUEST['subject'] ;

$message = $_REQUEST['message'] ;

 

mail("[email protected]", "Subject: $subject",

$message, "From: $email" );

echo "Thank you for using our mail form";

}

?>

 

This is the php code from the first emailer that works. I tried to add the $attachedfile after the $message but that didn't work. I'm new to php and Ive tried to look online but I couldn't find anything that would work for what I already had. Any ideas?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.