• Home
  • About WDC
  • Request a Tutorial
  • Free Web Directory
  • Advertising
  • News
  • Contact Us
  • My Portfolio
Web Designing Co!

Main Menu

  • Home
  • Web Design
    • Adobe Dreamweaver
    • PHP Script's
  • Graphic Design
  • Internet
  • Web Links
  • Free Web Directory
  • Jobs in ME

Web Tools

  • Broken Link Checker
  • Check Your Website Speed
  • Keyword Suggestion Tool
  • Backlink Checker

Featured Links:

Free Web Directory Listing
Human edited free web directory, SEO friendly. Submit your site 100% free.
Web Design Blog - useful tips and resource
webdesigningco.com is a web design blogs to share ideas, useful tips and techniques for beginners and advanced designers, coders and graphic artists.
Ads by WDC

Banners



Attaching Resume to website form PHP Script

This tutorial will teach you how to attach a file to your website form and send to specific email address using simple PHP Script.

With this script you can create online job application form for your company or clients. The user can attach a word document to this form and email it along with attachment.

Using this PHP script you can create:

  • Job Application Form
  • Employment web Form

File type you can attach to this form is ".doc" only. If you attach any other file the PHP will automatically change the extension to “.doc”.

Let’s start by creating a form, this script contents 1 html and 2 php file. This is an example script only; it can be customized as per your requirement.

- 01upload_resume.html
- 02submit_form.php
-
03thank_ you.php

About "01upload_resume.html" on this page user can upload his/her resume, after selecting the file when user click on upload resume it will take them to “02submit_form.php” the selected file will automatically gets saved on your web server. On “02submit_form.php” you can specify the location where you want to save the file.

<form action="02submit_form.php" method="post" enctype="multipart/form-data" name="form1" id="form1">
  <table width="100%" border="0" cellpadding="5" cellspacing="1" bgcolor="#FFFFFF">
    <tr>
      <td><p><strong>Step 1 of 2</strong></p>
        <p><strong> Upload your Resume</strong></p></td>
    </tr>
    <tr>
      <td>Select file:
        <input name="ufile" type="file" id="ufile" size="50" /></td>
    </tr>
    <tr>
      <td align="center"><input style="width:120px" type="submit" name="Submit" value="Upload Resume" /></td>
    </tr>
  </table>
</form>
 

02submit_form.php: After uploading file on server, this page display a form where user can fill-up personal information.

 
  <?php
//set where you want to store files
//in this example we keep file in same folder
//$HTTP_POST_FILES['ufile']['name']; = upload file name
//for example upload file name resume.doc . $path will be /resume.doc
$path= "".$HTTP_POST_FILES['ufile']['name'];
if($ufile !=none)
{
if(copy($HTTP_POST_FILES['ufile']['tmp_name'], $path))
{
echo "<p>Your Resume is successfully uploaded, please fill below form to complete your application.</p>";
 
//$HTTP_POST_FILES['ufile']['name'] = file name
//$HTTP_POST_FILES['ufile']['size'] = file size
//$HTTP_POST_FILES['ufile']['type'] = type of file
echo "File Name: ".$HTTP_POST_FILES['ufile']['name']."<BR/>";
echo "File Size: ".$HTTP_POST_FILES['ufile']['size']."<BR/>";
}
else
{
echo "Error uploading your resume.";
}
}
$destination_file = "$path";
?>
 
 
<form name="form1" method="post" action="03thank_ you.php" onSubmit="return validate_form(this)" >
  <p>
    <input name="id" type="hidden" id="id" value="<?php echo $destination_file; ?>">
  </p>
  <table width="460" border="0" cellpadding="5" cellspacing="0" bgcolor="#FFFFFF">
    <tr>
      <td><table  border="0" cellpadding="2" cellspacing="1">
          <tr>
            <td><strong>Applying for the Post of</strong><span class="redcolor">*</span></td>
            <td><input name="post" type="text" id="post" size="50" maxlength="50" /></td>
          </tr>
          <tr>
            <td colspan="2"><img src="../images/spacer.gif" alt="" width="150" height="2" /></td>
          </tr>
          <tr>
            <td colspan="2"><h2>Personal Information</h2></td>
          </tr>
          <tr>
            <td><img src="../images/spacer.gif" alt="" width="150" height="1" />
 
              Full Name<span class="redcolor">*</span></td>
            <td><input name="name" type="text" id="name" size="38" maxlength="50" /></td>
          </tr>
          <tr >
            <td >Gender<span class="redcolor">*</span></td>
            <td  ><input type="radio" value="male" name="gender" style="width:15px;" />
              Male
              <input type="radio" value="female" name="gender" style="width:15px;" />
              Female</td>
          </tr>
          <tr >
            <td>Date of Birth<span class="redcolor">*</span></td>
            <td><input name="dob" type="text" id="dob" size="20" maxlength="11" />
              <small>(example: 06-sep-2007)</small></td>
          </tr>
          <tr >
            <td>Age<span class="redcolor">*</span></td>
            <td><input name="age" type="text" id="age" onKeyPress="AllowNumber();" size="4" maxlength="2" /></td>
          </tr>
          <tr >
            <td>Marital Status<span class="redcolor">*</span></td>
            <td><select name="marital" class="searchBox" id="marital" style="width:100px; " onFocus="return chkdob();">
                <option selected="">Select</option>
                <option value ="Single" >Single</option>
                <option value ="Married" >Married</option>
                <option value ="Separated" >Separated</option>
                <option value ="Divorced" >Divorced</option>
                <option value ="Widowed" >Widowed</option>
              </select>
            </td>
          </tr>
          <tr>
            <td>Country Of Origin</td>
            <td colspan="1"><select name="origin" class="searchBox" onFocus="return chkmarital();" onChange="return origin_change(this.selectedIndex)">
                <option value="" selected="selected">Select</option>
                <option value="United States">United States</option>
                <option value="Canada">Canada</option>
                <option value="Zimbabwe">Zimbabwe</option>
              </select></td>
          </tr>
          <tr>
            <td>Nationality<span class="redcolor">*</span></td>
            <td><select name="nationality" id="nationality" class="textArea" onFocus="return chkorigin();"  onchange="javascript:displayDualNatioanality();">
                <option value="" selected="selected">Select</option>
                <option value="United States">United States</option>
                <option value="Canada">Canada</option>
                <option value="Zimbabwe">Zimbabwe</option>
              </select></td>
          </tr>
        </table>
        <table  border="0" cellpadding="2" cellspacing="1">
          <tr>
            <td width="150"><img src="../images/spacer.gif" alt="" width="150" height="1" />
 
              Mobile Number<span class="redcolor">*</span></td>
            <td width="239"><input name="mobile" type="text" onKeyPress="AllowNumber();" maxlength="15" size="25" /></td>
          </tr>
          <tr>
            <td>Residence Number</td>
            <td><input name="resnumber" type="text" class="searchBox" onKeyPress="AllowNumber();" value="" maxlength="15" size="25" /></td>
          </tr>
        </table>
        <table  border="0" cellpadding="2" cellspacing="1">
          <tr >
            <td><img src="../images/spacer.gif" alt="" width="150" height="1" />
 
              Email ID<span class="redcolor">*</span></td>
            <td><input name="email" type="text" class="searchBox" value=""  maxlength="50" size="38" /></td>
          </tr>
          <tr>
            <td>Alternate Email Id</td>
            <td><input name="altemail" type="text" class="searchBox" id="altemail" onFocus="return chkmail();" value="" size="38"  maxlength="50" /></td>
          </tr>
          <tr>
            <td>Current Sponsorship<span class="redcolor">*</span></td>
            <td><select name="currentsponsor" id="currentsponsor" >
                <option value="" selected="">Select</option>
                <option value="Company Sponsorship">Company Sponsorship</option>
                <option value="Fathers Sponsorship">Father's Sponsorship</option>
                <option value="Husband's Sponsorship">Husband's Sponsorship</option>
                <option value="Transit Visa">Transit Visa</option>
                <option value="UAE / GCC National">UAE / GCC National</option>
                <option value="Visit Visa">Visit Visa</option>
                <option value="Wife's Sponsorship">Wife's Sponsorship</option>
                <option value="Not Applicable">Not Applicable</option>
              </select></td>
          </tr>
          <tr>
            <td>Visa Valid Till<span class="redcolor">*</span></td>
            <td><input name="validity" type="text" maxlength="11" onBlur="validateDate(this);" value="" size="20"/>
              <small>(example: 06-sep-2007)</small> </td>
          </tr>
          <tr >
            <td colspan="2" class="subHead"> </td>
          </tr>
          <tr >
            <td colspan="2" class="subHead"><strong>Emergency Contact</strong></td>
          </tr>
          <tr >
            <td>Name of the Person</td>
            <td><input name="econtactper" type="text" class="searchBox" id="econtactper"  onfocus="return chkspons();" value="" size="30"  maxlength="50" /></td>
          </tr>
          <tr >
            <td>Contact Number</td>
            <td><input name="econtactphone" type="text" class="searchBox" id="econtactphone" onKeyPress="AllowNumber();" value="" size="30" maxlength="15" /></td>
          </tr>
        </table>
        <h2>Languages Known</h2>
        <table  border="0" cellpadding="2" cellspacing="1">
          <tr>
            <td><b><img src="../images/spacer.gif" alt="" width="170" height="1" />
 
              Language</b></td>
            <td width="50" align="center"><b>Read</b></td>
            <td width="50" align="center"><b>Write</b></td>
            <td width="50" align="center"><b>Speak</b></td>
          </tr>
          <tr>
            <td><input name="lang01" type="text" class="searchBox" id="lang01"  onfocus="return chkspons();" value="" size="30"  maxlength="50" /></td>
            <td align="center"><input name="lang01r" type="checkbox" id="lang01r" value="Read," /></td>
            <td align="center"><input name="lang01w" type="checkbox" id="lang01w" value="Write," /></td>
            <td align="center"><input name="lang01s" type="checkbox" id="lang01s" value="Speak" /></td>
          </tr>
          <tr>
            <td><input name="lang02" type="text" class="searchBox" id="lang02"  onfocus="return chkspons();" value="" size="30"  maxlength="50" /></td>
            <td align="center"><input name="lang02r" type="checkbox" id="lang02r" value="Read," /></td>
            <td align="center"><input name="lang02w" type="checkbox" id="lang02w" value="Write," /></td>
            <td align="center"><input name="lang02s" type="checkbox" id="lang02s" value="Speak" /></td>
          </tr>
          <tr>
            <td><input name="lang03" type="text" class="searchBox" id="lang03"  onfocus="return chkspons();" value="" size="30"  maxlength="50" /></td>
            <td align="center"><input name="lang03r" type="checkbox" id="lang03r" value="Read," /></td>
            <td align="center"><input name="lang03w" type="checkbox" id="lang03w" value="Write," /></td>
            <td align="center"><input name="lang03s" type="checkbox" id="lang03s" value="Speak" /></td>
          </tr>
          <tr>
            <td><input name="lang04" type="text" class="searchBox" id="lang04"  onfocus="return chkspons();" value="" size="30"  maxlength="50" /></td>
            <td align="center"><input name="lang04r" type="checkbox" id="lang04r" value="Read," /></td>
            <td align="center"><input name="lang04w" type="checkbox" id="lang04w" value="Write," /></td>
            <td align="center"><input name="lang04s" type="checkbox" id="lang04s" value="Speak" /></td>
          </tr>
        </table>
        <table width="443"  border="0" cellpadding="2" cellspacing="1">
          <tr >
            <td colspan="4" class="subHead"><strong>Other Information</strong></td>
          </tr>
          <tr >
            <td>Driving License<span class="redcolor">*</span></td>
            <td><select name="licence" class="searchBox" id="licence" onChange="showOtherLicence(this.selectedIndex)">
                <option value ="" selected="">Select</option>
                <option value ="UAE" >UAE</option>
                <option value ="GCC" >GCC</option>
                <option value ="International" >International</option>
                <option value =" " >Other</option>
                <option value ="Not Applicable" >Not Applicable</option>
              </select></td>
            <td id="lblOtherLicence">If Other :  </td>
            <td id="txtOtherLicence"><input name="otherlicence" type="text" class="searchBox" id ="otherlicence" size="20" maxlength="50" />
            </td>
          </tr>
        </table>
 
 
        <table border="0" cellpadding="2" cellspacing="1" id="tab1">
          <tr>
            <td>Kindly Type Your Cover Letter<span class="redcolor">*</span></td>
          </tr>
          <tr>
            <td><textarea name="copycv" cols="71" rows="8" wrap="hard" class="textArea" style="width:380px; " onKeyUp="return ismaxlength(this)" maxlength="7999"></textarea></td>
          </tr>
        </table>
        <p><b>By submitting, I agree that all info entered was done accurately &amp; truthfully.</b>
 
          I accept:
          <input type="checkbox" value="0" name="agree" />
        </p></td>
    </tr>
  </table>
  <p>
    <input style="width:120px" type="submit" name="Submit" value="Submit">
  </p>
</form>

03thank_ you.php: Finally your form is sent to the specific email.

<?php 
 
$post = $_POST['post'];
 
$name = $_POST['name'];
$gender = $_POST['gender'];
$dob = $_POST['dob'];
$age = $_POST['age'];
$marital = $_POST['marital'];
$origin = $_POST['origin'];
$nationality = $_POST['nationality'];
 
$address = $_POST['address'];
$currentcountry = $_POST['currentcountry'];
$mobile = $_POST['mobile'];
$resnumber = $_POST['resnumber'];
$email = $_POST['email'];
$altemail = $_POST['altemail'];
$currentsponsor = $_POST['currentsponsor'];
$validity = $_POST['validity'];
 
$econtactper = $_POST['econtactper'];
$econtactphone = $_POST['econtactphone'];
 
$lang01 = $_POST['lang01'];
$lang01r = $_POST['lang01r'];
$lang01w = $_POST['lang01w'];
$lang01s = $_POST['lang01s'];
 
$lang02 = $_POST['lang02'];
$lang02r = $_POST['lang02r'];
$lang02w = $_POST['lang02w'];
$lang02s = $_POST['lang02s'];
 
$lang03 = $_POST['lang03'];
$lang03r = $_POST['lang03r'];
$lang03w = $_POST['lang03w'];
$lang03s = $_POST['lang03s'];
 
$lang04 = $_POST['lang04'];
$lang04r = $_POST['lang04r'];
$lang04w = $_POST['lang04w'];
$lang04s = $_POST['lang04s'];
 
$licence = $_POST['licence'];
$otherlicence = $_POST['otherlicence'];
 
$copycv=ucfirst($_REQUEST["copycv"]);
 
//$filleant takes the value of the resume that was just uploaded with the unique name to the ftp in the www.yourname.com/upload/
$fileatt = "".$_POST['id']; // Path to the file                  
$fileatt_type = "application/octet-stream"; // File Type 
//here i made the file that will be sent as attachment to have the name "CV_name_surname.doc" you can make it what format you like,
//i needed the doc format... and i'll modify this code to accept just doc file later...i'm really tired right now :D
$fileatt_name = "CV_".$_POST['name'].".doc"; // Filename that will be used for the file as the attachment 
 
//$email_from is the variable that gets the value, of the From: field that will appear in your received mail 
$email_from = $_POST['email']; // Who the email is from 
 
//Here you define the subject of you message
$email_subject = "Job Application"; // The Subject of the email 
 
//here you define the body of the message, the message itself
//you can modify the "post" textfield in sendmail.php to a textarea....
$email_message = "
 
<table width='555' border='0' align='center' cellpadding='8' cellspacing='1'>  
  <tr>
    <td colspan='2' style='font-family:Arial; font-size:16px; color:#333333;'><strong>Application for: <span style='color:#FF0000;'>$post \n</span></strong></td>
  </tr>
  <tr bgcolor='#eeeeee'>
    <td colspan='2' bgcolor='#CCCCCC' style='font-family:Arial; font-size:14px; color:#333333;'><strong>Personal Information:</strong></td>
  </tr>
  <tr bgcolor='#eeeeee'>
    <td width='163' style='font-family:Verdana, Arial; font-size:12px; color:#333333;'><strong>Full Name:</strong></td>
    <td width='357' style='font-family:Verdana, Arial; font-size:12px; color:#333333;'>$name \n</td>
  </tr>
  <tr bgcolor='#eeeeee'>
    <td style='font-family:Verdana, Arial; font-size:12px; color:#333333;'><strong>Gender:</strong></td>
    <td style='font-family:Verdana, Arial; font-size:12px; color:#333333;'>$gender \n</td>
  </tr>
  <tr bgcolor='#eeeeee'>
    <td style='font-family:Verdana, Arial; font-size:12px; color:#333333;'><strong>Date of Birth:</strong></td>
    <td style='font-family:Verdana, Arial; font-size:12px; color:#333333;'>$dob, Age: $age \n</td>
  </tr>
  <tr bgcolor='#eeeeee'>
    <td style='font-family:Verdana, Arial; font-size:12px; color:#333333;'><strong>Marital Status:</strong></td>
    <td style='font-family:Verdana, Arial; font-size:12px; color:#333333;'>$marital \n</td>
  </tr>
  <tr bgcolor='#eeeeee'>
    <td style='font-family:Verdana, Arial; font-size:12px; color:#333333;'><strong> Country Of Origin:</strong></td>
    <td style='font-family:Verdana, Arial; font-size:12px; color:#333333;'>$origin \n</td>
  </tr>
  <tr bgcolor='#eeeeee'>
    <td style='font-family:Verdana, Arial; font-size:12px; color:#333333;'><strong>Nationality:</strong></td>
    <td style='font-family:Verdana, Arial; font-size:12px; color:#333333;'>$nationality  \n</td>
  </tr>
  <tr bgcolor='#CCCCCC'>
    <td colspan='2' style='font-family:Arial; font-size:16px; color:#333333;'><strong>Contact Information:</strong></td>
  </tr>
  <tr bgcolor='#eeeeee'>
    <td style='font-family:Verdana, Arial; font-size:12px; color:#333333;'><strong>Address:</strong></td>
    <td style='font-family:Verdana, Arial; font-size:12px; color:#333333;'>$address \n</td>
  </tr>
  <tr bgcolor='#eeeeee'>
    <td style='font-family:Verdana, Arial; font-size:12px; color:#333333;'><strong>Current Location:</strong></td>
    <td style='font-family:Verdana, Arial; font-size:12px; color:#333333;'>$currentcountry \n</td>
  </tr>
  <tr bgcolor='#eeeeee'>
    <td style='font-family:Verdana, Arial; font-size:12px; color:#333333;'><strong>Mobile Number:</strong></td>
    <td style='font-family:Verdana, Arial; font-size:12px; color:#333333;'>$mobile \n</td>
  </tr>
  <tr bgcolor='#eeeeee'>
    <td style='font-family:Verdana, Arial; font-size:12px; color:#333333;'><strong>Residence Number:</strong></td>
    <td style='font-family:Verdana, Arial; font-size:12px; color:#333333;'>$resnumber \n</td>
  </tr>
  <tr bgcolor='#eeeeee'>
    <td style='font-family:Verdana, Arial; font-size:12px; color:#333333;'><strong>Email:</strong></td>
    <td style='font-family:Verdana, Arial; font-size:12px; color:#333333;'><a href='mailto:$email'>$email \n</a></td>
  </tr>
  <tr bgcolor='#eeeeee'>
    <td style='font-family:Verdana, Arial; font-size:12px; color:#333333;'><strong>Alternate Email Id:</strong></td>
    <td style='font-family:Verdana, Arial; font-size:12px; color:#333333;'>$altemail \n</td>
  </tr>
  <tr bgcolor='#eeeeee'>
    <td style='font-family:Verdana, Arial; font-size:12px; color:#333333;'><strong>Current Sponsorship:</strong></td>
    <td style='font-family:Verdana, Arial; font-size:12px; color:#333333;'>$currentsponsor \n</td>
  </tr>
  <tr bgcolor='#eeeeee'>
    <td style='font-family:Verdana, Arial; font-size:12px; color:#333333;'><strong>Visa Valid Till:</strong></td>
    <td style='font-family:Verdana, Arial; font-size:12px; color:#333333;'>$validity \n</td>
  </tr>
  <tr bgcolor='#eeeeee'>
    <td colspan='2' bgcolor='#CCCCCC' style='font-family:Arial; font-size:16px; color:#333333;'><strong>Emergency Contact:</strong></td>
  </tr>
  <tr bgcolor='#eeeeee'>
    <td style='font-family:Verdana, Arial; font-size:12px; color:#333333;'><strong>Name of the Person:</strong></td>
    <td style='font-family:Verdana, Arial; font-size:12px; color:#333333;'>$econtactper \n</td>
  </tr>
  <tr bgcolor='#eeeeee'>
    <td style='font-family:Verdana, Arial; font-size:12px; color:#333333;'><strong>Contact Number:</strong></td>
    <td style='font-family:Verdana, Arial; font-size:12px; color:#333333;'>$econtactphone \n</td>
  </tr>
  <tr bgcolor='#eeeeee'>
    <td colspan='2' bgcolor='#CCCCCC' style='font-family:Arial; font-size:16px; color:#333333;'><strong>Other Details</strong></td>
  </tr>
  <tr bgcolor='#eeeeee'>
    <td style='font-family:Verdana, Arial; font-size:12px; color:#333333;'><strong>Driving License:</strong></td>
    <td style='font-family:Verdana, Arial; font-size:12px; color:#333333;'>$licence, $otherlicence \n</td>
  </tr>
  <tr bgcolor='#eeeeee'>
    <td style='font-family:Verdana, Arial; font-size:12px; color:#333333;'><strong>Language knows:</strong></td>
    <td style='font-family:Verdana, Arial; font-size:12px; color:#333333;'>$lang01, $lang01r $lang01w $lang01s \n
 
    $lang02, $lang02r $lang02w $lang02s \n
 
    $lang03, $lang03r $lang03w $lang03s \n
 
    $lang04, $lang04r $lang04w $lang04s \n</td>
  </tr>
 
  <tr bgcolor='#eeeeee'>
    <td colspan='2' valign='top' bgcolor='#eeeeee' style='font-family:Verdana, Arial; font-size:12px; color:#333333;'><strong>Cover Letter:</strong></td>
  </tr>
  <tr bgcolor='#eeeeee'>
    <td colspan='2' valign='top' bgcolor='#eeeeee' style='font-family:Verdana, Arial; font-size:12px; color:#333333;'>$copycv \n</td>
  </tr>
</table>
 
"; // Message that the email has in it 
 
//here you enter the e-mail address to wich you want the message to be sent
$email_to = "
 <script language='JavaScript' type='text/javascript'>
 <!--
 var prefix = 'm&#97;&#105;lt&#111;:';
 var suffix = '';
 var attribs = '';
 var path = 'hr' + 'ef' + '=';
 var addy49123 = 'n&#97;m&#101;' + '&#64;';
 addy49123 = addy49123 + 'c&#111;mp&#97;nyn&#97;m&#101;' + '&#46;' + 'c&#111;m';
 document.write( '<a ' + path + '\'' + prefix + addy49123 + suffix + '\'' + attribs + '>' );
 document.write( addy49123 );
 document.write( '<\/a>' );
 //-->
 </script> <script language='JavaScript' type='text/javascript'>
 <!--
 document.write( '<span style=\'display: none;\'>' );
 //-->
 </script>This e-mail address is being protected from spambots. You need JavaScript enabled to view it
 <script language='JavaScript' type='text/javascript'>
 <!--
 document.write( '</' );
 document.write( 'span>' );
 //-->
 </script>"; // Who the email is too 
 
//adds the e-mail address of the sender
$headers = "From: ".$_POST['email']; 
 
$semi_rand = md5(time()); 
$mime_boundary = "==Multipart_Boundary_x{$semi_rand}x"; 
 
$headers .= "\nMIME-Version: 1.0\n" . 
            "Content-Type: multipart/mixed;\n" . 
            " boundary=\"{$mime_boundary}\""; 
 
$email_message .= "This is a multi-part message in MIME format.\n\n" . 
                "--{$mime_boundary}\n" . 
                "Content-Type:text/html; charset=\"iso-8859-1\"\n" . 
               "Content-Transfer-Encoding: 7bit\n\n" . 
$email_message . "\n\n"; 
 
 
 
/********************************************** First File ********************************************/ 
 
//$filleant takes the value of the picture that was jut uploaded with the unique name to the ftp in the www.yourname.com/
$fileatt = "".$_POST['id']; // Path to the file                  
 
$fileatt_type = "application/octet-stream"; // File Type 
 
//here i made the file that will be sent as attachment to have the name "CV_name_surname.doc" you can make it what format you like,
//i needed the doc format... and i'll modify this code to accept just doc file later...i'm really tired right now :D
$fileatt_name = "CV_".$_POST['name'].".doc"; // Filename that will be used for the file as the attachment 
 
$file = fopen($fileatt,'rb'); 
$data = fread($file,filesize($fileatt)); 
fclose($file); 
 
 
$data = chunk_split(base64_encode($data)); 
 
$email_message .= "--{$mime_boundary}\n" . 
                  "Content-Type: {$fileatt_type};\n" . 
                  " name=\"{$fileatt_name}\"\n" . 
                  //"Content-Disposition: attachment;\n" . 
                  //" filename=\"{$fileatt_name}\"\n" . 
                  "Content-Transfer-Encoding: base64\n\n" . 
                 $data . "\n\n" . 
                  "--{$mime_boundary}\n"; 
unset($data); 
unset($file); 
unset($fileatt);
unset($fileatt_type); 
unset($fileatt_name); 
 
/********************************************** End of File Config ********************************************/ 
 
// To add more files just copy the file section again, but make sure they are all one after the other! If they are not it will not work! 
 
$ok = @mail($email_to, $email_subject, $email_message, $headers); 
if($ok) { 
echo "Thank you! for sending your resume, we will get back to you soon. <a href='http://www.yoursitename.com/'>continue browsing our website...</a> "; 
} else { 
die("Sorry but the email could not be sent. Please go back and try again! or <a href='01upload_resume.html'>click here...</a>"); 
} 
?>
<p> </p>
 

The Code's highlighted with GeSHi - Want to add it on your website?

 
Copyright © 2007-2009 Web Designing Co!. All rights reserved. Email: info(a)webdesigningco.com.
cssandhtml