PHP file upload issue
<p>I'm working on a form-mailer that includes a file upload but the file doesn't show up in the test E-mail at all.I've tweaked and re-tweaked but to no avail. Any suggestions?</p>

<p>The HTMl part of the form is as shown below</p>

<pre><code>&lt;div class="contactleft"&gt;


        &lt;form action="former.php" method="post" enctype="multipart/form-data" id="former"&gt;

        &lt;div class="textbox"&gt;&lt;span id="sprytextfield1"&gt;
          &lt;label for="fname"&gt;&lt;/label&gt;
          &lt;input name="fname" type="text" class="inputer" id="fname" /&gt;
          &lt;span class="textfieldRequiredMsg"&gt;A value is required.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;!-- End TectBox --&gt;
        &lt;div class="textbox"&gt;&lt;span id="sprytextfield2"&gt;
          &lt;label for="lname"&gt;&lt;/label&gt;
          &lt;input name="lname" type="text" class="inputer" id="lname" /&gt;
          &lt;span class="textfieldRequiredMsg"&gt;A value is required.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;!-- End TectBox --&gt;
        &lt;div class="textbox"&gt;&lt;span id="sprytextfield3"&gt;
          &lt;label for="email"&gt;&lt;/label&gt;
          &lt;input name="email" type="text" class="inputer" id="email" /&gt;
          &lt;span class="textfieldRequiredMsg"&gt;A value is required.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;!-- End TectBox --&gt;
        &lt;div class="textbox"&gt;&lt;span id="sprytextfield4"&gt;
          &lt;label for="file"&gt;&lt;/label&gt;
          &lt;label for="file"&gt;&lt;/label&gt;
          &lt;label for="fileField"&gt;&lt;/label&gt;
          &lt;input type="file" name="fileField" id="fileField" /&gt;
          &lt;span class="textfieldRequiredMsg"&gt;A value is required.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;!-- End TectBox --&gt;


        &lt;div class="textbox"&gt;
          &lt;label for="sender"&gt;&lt;/label&gt;
          &lt;input type="submit" name="sender" id="sender" value="click to send message" /&gt;
        &lt;/div&gt;&lt;!-- End TextBox --&gt;

          &lt;/form&gt;

     &lt;/div&gt;
</code></pre>

<p>and the mailer is as shown below</p>

<pre><code>   &lt;?
   $mailto = 'info@siteripe.com'; // insert the email address you want the form sent to
    //$returnpage = 'thanks.php'; // insert the name of the page/location you want the user to be returned to//
    $sitename = '[siteripe.com]'; // insert the site name here, it will appear in the subject of your email

/* Do not edit below this line unless you know what you're doing */

  $fname = $_POST['fname'];
  $lname = $_POST['lname'];
  $email = $_POST['email'] ;
   $file = $_POST['file'];
   $subject = $_POST['subject'];


    if (!eregi("^[a-z0-9]+([-_\.]?[a-z0-9])+@[a-z0-9]+([-_\.]?[a-z0-9])+\.[a-z]{2,4}", $email)){
    print("&lt;strong&gt;Error:&lt;/strong&gt; this email address is not in a valid format.&lt;br/&gt;&lt;br/&gt;&lt;a href='javascript:history.go(-1)'&gt;Back&lt;/a&gt;");
         exit;
    }   

  $message = "\n$name submitted the following message:\n\n$message\n\n$name's contact details are as follows:\n\nFirst Name: $fname\nLast Name: $lname\nEmail Address: $email\nForm: $file";

  mail($mailto, "$subject", $message, "From: $email");

?&gt; 
</code></pre>
