title: 500 Internal Server Error on PHP form
body: <p>I'm pretty new with PHP. I'm having trouble with a form I'm working with.</p>
  
  <p>Here is my HTML</p>
  
  <pre><code>&lt;form class="form-horizontal" action="submit.php"&gt;
      &lt;div class="form-group"&gt;
          &lt;label for="name" class="col-sm-2 control-label"&gt;Name:&lt;/label&gt;
          &lt;div class="col-sm-10"&gt;
              &lt;input type="text" class="form-control" id="name" name = "name" placeholder="John Doe"&gt;
          &lt;/div&gt;
      &lt;/div&gt;
      &lt;div class = "form-group"&gt;
          &lt;label for="inputEmail3" class="col-sm-2 control-label"&gt;Email:&lt;/label&gt;
          &lt;div class="col-sm-10"&gt;
              &lt;input type="email" class="form-control" id="email" name = "email" placeholder="name@domain.com"&gt;
          &lt;/div&gt;
      &lt;/div&gt;
      &lt;div class="form-group"&gt;
          &lt;label for="phoneNumber" class="col-sm-2 control-label"&gt;Phone:&lt;/label&gt;
          &lt;div class="col-sm-10"&gt;
              &lt;input type="text" class="form-control" id="phoneNumber" name = "phoneNumber" placeholder="555-555-5555"&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  
      &lt;div class="form-group"&gt;
          &lt;label for="major" class="col-sm-2 control-label"&gt;Major:&lt;/label&gt;
          &lt;div class="dropdown"&gt;
              &lt;button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu1" name = "major" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true"&gt;
                  Dropdown
                  &lt;span class="caret"&gt;&lt;/span&gt;
              &lt;/button&gt;
              &lt;ul class="dropdown-menu" aria-labelledby="dropdownMenu1"&gt;&lt;/ul&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  
      &lt;hr&gt;
  
      &lt;div class="form-group"&gt;
          &lt;label for="itemForSale" class="col-sm-2 control-label"&gt;Item for Sale:&lt;/label&gt;
          &lt;div class="col-sm-10"&gt;
              &lt;input type="text" class="form-control" id="itemForSale1" name = "itemForSale1" placeholder="My old video games, some chairs, some chicken, a pizza."&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  
      &lt;div class="form-group"&gt;
          &lt;label for="quantity" class="col-sm-2 control-label"&gt;Quantity:&lt;/label&gt;
          &lt;div class="col-sm-10"&gt;
              &lt;input type="text" class="form-control" id = "quantity1" name = "quantity1" placeholder="1,000,000"&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  
      &lt;div class="form-group"&gt;
          &lt;label for="major" class="col-sm-2 control-label"&gt;Price:&lt;/label&gt;
          &lt;div class="col-sm-10"&gt;
              &lt;input type="text" class="form-control" id="price1" name = "price1" placeholder="ex. $100.00"&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>Here is my PHP</p>
  
  <pre><code>&lt;?php
      // Variables
      $name;
      $email;
      $phone;
      $major;
      $itemForSale1;
      $quantity1;
      $price1;
      $itemForSale2;
      $quantity2;
      $price2;
      $itemForSale3;
      $quantity3;
      $price3;
  
      ini_set('display_errors', 'On'); ini_set('html_errors', 0); error_reporting(-1);
  
      if (isset($_POST["submit"]))
      {
          // Initiate the variables
          $name         = $_POST["name"];
          $email        = $_POST["email"];
          $phone        = $_POST["phone"];
          $major        = $_POST["major"];
          $itemForSale1 = $_POST["itemForSale1"];
          $quantity1    = $_POST["quantity1"];
          $price1       = $_POST["price1"];
          $itemForSale2 = $_POST["itemForSale2"];
          $quantity2    = $_POST["quantity2"];
          $price2       = $_POST["price2"];
          $itemForSale3 = $_POST["itemForSale3"];
          $quantity3    = $_POST["quantity3"];
          $price3       = $_POST["price3"];
  
          // IF name is empty string
          if($name == "")
          {
              // Alert the user
              echo "Please enter your name.";
          }
  
          // IF email is invalid
          if (!filter_var($email, FILTER_VALIDATE_EMAIL) === true)
          {
              // Alert the user
              echo("$email is an invalid email address");
          }
  
          // Strip any occurrences of '-' in phoneNumber
          str_replace("-", "", $phoneNumber)
  
          // IF phoneNumber does not equal 10 characters
          if(strlen(phoneNumber) != 10)
          {
              // Alert the user
              echo "Invalid phone number. Ex. 315-555-5555";
          }
  
          // IF itemForSale is empty string
          if($itemForSale == "")
          {
              // Alert the user
              echo "You must enter at least one item.";
          }
  
          // IF quantity1 is less than 1
          if($quantity1 &lt; 1)
          {
              // Alert the user
              echo "You can't sell anything less than one item.";
          }
  
          // Strip any occurrences of '$' in price
          str_replace("$", "", $phoneNumber)
  
          // IF price is less than 0.00
          if($price1 &lt; 0)
          {
              echo "What's less than free?";
          }
  
          echo $name;
          echo $email;
          echo $phone;
          echo $major;
          echo $itemForSale1;
          echo $quantity1;
          echo $price1;
  
      }
  ?&gt;
  </code></pre>
  
  <p>When I press submit on my form I get the 500 Internal Server Error. Any idea what might be causing this? I'm not very familiar with PHP sooo.</p>