title: 500 Internal Error, Whats wrong with my code?
body: <p>Im having a little issue with my coding, i keep getting a 500 error when i run this script:</p>
  
  <pre><code>&lt;?php
  include_once("../../includes/connect.php");
  if (isset($_POST['action']) &amp;&amp; $_POST['action'] == "check"){
  $email = mysql_real_escape_string(strip-tags($_POST['email']));
  $username = mysql_real_escape_string(strip_tags($_POST['username']));
  
  if (strpos($email,"@")!== false){
      $check_email = explode("@",$email);
      if (strpos($check_email[1],".")=== false){
          echo 3;
          exit();
      }
  } else {
      echo 3;
      exit();
  }
  $email_query = mysql_query("SELECT id FROM users WHERE email='$email' LIMIT 1");
  if (mysql_num_rows($email_query)== 1){
      //Email already exists
      echo 1;
      exit();
  } else {
      $username_query = mysql_query("SELECT username FROM users WHERE username='$username' LIMIT 1");
      if (mysql_num_rows($username_query)== 1){
          //Username already exists
          echo 2;
          exit();
      } else {
          //Everything is fine
          echo 0;
          exit();
      }
  }
  }
  if (isset($_POST['action']) &amp;&amp; $_POST['action'] == "register"){
      $username = mysql_real_escape_string(strip_tags($_POST['username']));
      $password = mysql_real_escape_string(strip_tags($_POST['password']));
      $email = mysql_real_escape_string(strip_tags($_POST['email']));
  
      $activation_code = md5($username.$password);
  
      $reg_query = mysql_query("INSERT INTO users (username, password, email, activfation_code) VALUES ('$username', '".md5($password)."', '$email', '$activation_code')");
      if ($reg_query){
          //Successfully registered
          $new_userid = mysql_insert_id();
          //Create new users folder
          #mkdir("../users/$new_userid", 0755);
          //Create new users images folder
          #mkdir("../users/$new_userid/images", 0755);
          //Create new users media folder
          #mkdir("../users/$new_userid/media", 0755);
  
          $to = $email;
          $from = "noreply@atradiesinc.com";
          $subject = "Activate your Account!";
  
          $message = "&lt;h3&gt;Welcome to Atradies Inc Gaming Community, ".$username."!&lt;/h3&gt;
          &lt;p&gt;To complete registration you must verify and activate your account. Click the link below and the magic shall happen.&lt;/p&gt;
          &lt;p&gt;&lt;a href='http://www.atradiesinc.com/network/?id=$new_userid&amp;activate=$activation_code'&gt;http://www.atradiesinc.com/network/?id=$new_userid&amp;activate=$activation_code&lt;/a&gt;&lt;/p&gt;
          &lt;p&gt;Once your account has been activated, you may login and join in with the community with the details below:&lt;br /&gt;
          &lt;strong&gt;Username: &lt;/strong&gt;$username&lt;br /&gt;
          &lt;strong&gt;Password: &lt;/strong&gt;&lt;i&gt;Password you supplied on registration&lt;/i&gt;&lt;/p&gt;
          &lt;p&gt;Thank you and enjoy the community!&lt;/p&gt;";
  
          $headers = 'MIME-Version: 1.0' . "\r\n";
          $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
          $headers .= "From: $from\r\nReply-To: $from";
          mail($to, $subject, $message, $headers);
  
          echo 1;
          exit();
  
      } else {
          //Registration failed
          echo 0;
          exit();
      }
  }
  
  ?&gt;
  </code></pre>
  
  <p>Whats the problem? I cant seem to find any issue with it. Is it the code, or is it the server im trying it out on? Ive tried the Chrome Inspect Element console and it doesnt give any more information then '500 Internal Server Error' on that file.</p>
  
  <p>Thanks!</p>