title: Using the following jQuery script/ PHP to send attachments from a web page...
body: <p>I have a site <strong><a href="http://webfro.gs/south/kb2/documents-old.html" rel="nofollow">here</a></strong>. </p>
  
  <p>The way this page works is great. I can fill out all the fields, and attach a document and hit send and the email goes. </p>
  
  <p>There's a JSFiddle <strong><a href="http://jsfiddle.net/jlnewnam/vehy4/" rel="nofollow">here</a></strong>.</p>
  
  <pre><code>                    &lt;td style="font-size: 22px; font-weight: bold; text-align: center;"&gt;Forms &lt;br /&gt;you &lt;br /&gt;want to &lt;br /&gt;attach:&lt;/td&gt;
                          &lt;td style="padding-left: 20px;"&gt;
          &lt;input name="fileAttach[]" type="file" class="multi"&gt;&lt;br&gt;&lt;br&gt;
                          &lt;/td&gt;
  </code></pre>
  
  <p>However, I've set up another page <strong><a href="http://webfro.gs/south/kb2/documents-new.html" rel="nofollow">here</a></strong>. This is what I really want. </p>
  
  <p>But, behind each checkbox, I want there to be pre-defined document. An attachment of sorts. </p>
  
  <p><strong>The logic would work like this...</strong> </p>
  
  <ol>
  <li>'To' box and 'Subject' are filled out.</li>
  <li>The necessary check boxes are checked.</li>
  <li>Hit 'Send' and the email goes off.</li>
  </ol>
  
  <p>There's a JSFiddle for this one <strong><a href="http://jsfiddle.net/jlnewnam/228cU/" rel="nofollow">here</a></strong>.</p>
  
  <p><strong>Here's some code from that one...</strong></p>
  
  <pre><code>&lt;/div&gt;&lt;!-- Close Form Header --&gt;
      &lt;div class="form-column"&gt;&lt;!-- Column --&gt;
      &lt;div class="form-label"&gt;Financial Aid Forms&lt;/div&gt;&lt;!-- Label --&gt;
          &lt;div class="form-content"&gt;&lt;!-- Content --&gt;
              &lt;ul&gt;
                  &lt;li&gt;&lt;input name="fileAttach[]"  type="checkbox" class="multi"&gt;Finance Form 1&lt;/li&gt;&lt;br /&gt;
              &lt;/ul&gt;
         &lt;/div&gt;
  </code></pre>
  
  <p>I can't figure out how to configure the documents behind the check boxes. I simply want the documents to be pulled from the server. </p>
  
  <p>I'm not sure how to include a PHP file in a JSFiddle, so I'm posting the part that relates to the attachment here. </p>
  
  <pre><code>&lt;?
  $strTo = $_POST["txtTo"];
  $strSubject = $_POST["txtSubject"];
  $strMessage = nl2br($_POST["txtDescription"]);
  
  //*** Uniq id Session ***//
  $strSid = md5(uniqid(time()));
  
  $strHeader = "";
  $strHeader .= "From: ".$_POST["South University"]."&lt;".$_POST["txtFormEmail"]."&gt;\nReply-To: ".$_POST["txtFormEmail"]."";
  
  $strHeader .= "MIME-Version: 1.0\n";
  $strHeader .= "Content-Type: multipart/mixed; boundary=\"".$strSid."\"\n\n";
  $strHeader .= "This is a multi-part message in MIME format.\n";
  
  $strHeader .= "--".$strSid."\n";
  $strHeader .= "Content-type: text/html; charset=utf-8\n";
  $strHeader .= "Content-Transfer-Encoding: 7bit\n\n";
  $strHeader .= $strMessage."\n\n";
  
  //*** Attachment ***//
  for($i=0;$i&lt;count($_FILES["fileAttach"]["name"]);$i++)
  {
  if($_FILES["fileAttach"]["name"][$i] != "")
  {
  $strFilesName = $_FILES["fileAttach"]["name"][$i];
  $strContent = chunk_split(base64_encode(file_get_contents($_FILES["fileAttach"]["tmp_name"][$i])));
  $strHeader .= "--".$strSid."\n";
  $strHeader .= "Content-Type: application/octet-stream; name=\"".$strFilesName."\"\n";
  $strHeader .= "Content-Transfer-Encoding: base64\n";
  $strHeader .= "Content-Disposition: attachment; filename=\"".$strFilesName."\"\n\n";
  $strHeader .= $strContent."\n\n";
  }
  }
  
  $flgSend = @mail($strTo,$strSubject,null,$strHeader); // @ = No Show Error //
  
  if($flgSend)
  {
  echo "Mail send completed.";
  }
  else
  {
  echo "Cannot send mail.";
  }
  ?&gt;
  </code></pre>
  
  <p>Or if there's an easier way to do this, please let me know. I still want to maintain the same functionality described above. </p>