title: php email form Internal Server Error
body: <p>I've started working on php email forms for websites, I'm not sure if it's something in the code or something else but i keep on getting the Internal Server Error showing up when i test them online.</p>
  
  <p>The following is the php and html code as an example.</p>
  
  <p>HTML</p>
  
  <pre><code> &lt;form action="form.php" method="post" name="Contact form"&gt;
   &lt;p&gt;First Name:
   &lt;input name="first_name" type="text" /&gt;
   &lt;/p&gt;
   &lt;p&gt;
  
  Last Name:
  &lt;input name="last_name" type="text" /&gt;
    &lt;/p&gt;
     &lt;p&gt;
  
  Email:
  &lt;input name="email" type="text" /&gt;
     &lt;/p&gt;
     &lt;p&gt;
       Message:
       &lt;textarea name="message" id="textarea" cols="30" rows="5"&gt;&lt;/textarea&gt;
     &lt;/p&gt;
     &lt;p&gt;
  &lt;input type="submit" name="Submit" id="Submit" value="Submit" /&gt;
  &lt;input type="reset" name="reset" id="reset" value="Reset" /&gt;
     &lt;/p&gt;
  
   &lt;/form&gt;
  </code></pre>
  
  <p>PHP</p>
  
  <pre><code> &lt;?php
  
   $first_name = $_POST['first_name'];
   $last_name = $_POST['last_name'];
   $first_name = $_POST['email'];
   $first_name = $_POST['message'];
  
   $to = "joel@justjoel.co.uk";
   $subject = "New Message";
  
   mail ($to, $subject, $message, "From:" . $first_name . $last_name);
   echo "Your message has been sent";
  
   ?&gt;
  </code></pre>
  
  <p>This is the error message</p>
  
  <p>Internal Server Error</p>
  
  <p>The server encountered an internal error or misconfiguration and was unable to complete your request.</p>
  
  <p>Please contact the server administrator, webmaster@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.</p>
  
  <p>More information about this error may be available in the server error log.</p>
  
  <p>Apache/2.2.3 (CentOS) Server at justjoel.co.uk Port 80</p>