title: WAMP Issue With PHP
body: <p>Please excuse my terrible formatting, I am teaching myself html, css, and php.</p>
  <p>I have a folder on my WAMP www folder, with html, css, and php. I am trying to get the information inputed in the form to get sent to an email address. My html with css shows up fine on the localhost,however when I click the submit button the url on the localhost changes to the php file, but I get a &quot;localhost refused to connect.&quot; Besides, well, everything, what am I doing wrong here?</p>
  <p>This is the html file</p>
  <pre><code>&lt;!DOCTYPE&gt;
  &lt;html&gt;
      
      &lt;link rel = &quot;stylesheet&quot; href = &quot;css/text.css&quot;&gt;
  
      
  
      &lt;body background=&quot;image/wallpaperbetter.jpg&quot;&gt;
  
          &lt;p&gt; //code
  
          &lt;/p&gt;
  
      &lt;/body&gt;
  
      &lt;div&gt;
          &lt;form method = &quot;post&quot; name = &quot;myemailform&quot; action = &quot;https://localhost/xxxx/form-to-email.php&quot;&gt;
  
              &lt;label for=&quot;name&quot;&gt;Name(optional):&lt;/label&gt;
              &lt;input type = &quot;text&quot;&gt;&lt;br&gt;
  
              &lt;label for=&quot;Home&quot;&gt;Home:&lt;/label&gt;
              &lt;input type = &quot;text&quot;&gt;&lt;br&gt;
  
              &lt;label for=&quot;City&quot;&gt;City:&lt;/label&gt;
              &lt;input type = &quot;text&quot;&gt;&lt;br&gt;
  
              &lt;label for=&quot;State&quot;&gt;State:&lt;/label&gt;
              &lt;input type = &quot;text&quot;&gt;&lt;br&gt;
  
              &lt;label for=&quot;Zip Code&quot;&gt;Zip Code:&lt;/label&gt;
              &lt;input type = &quot;text&quot;&gt;&lt;br&gt;
  
              &lt;label for=&quot;Country&quot;&gt;Country:&lt;/label&gt;
              &lt;input type = &quot;text&quot;&gt;&lt;br&gt;
  
              &lt;input type = &quot;submit&quot; value = &quot;submit&quot;&gt;
  
  
          &lt;/form&gt;
      &lt;/div&gt;
      
  
  &lt;/html&gt;
  </code></pre>
  <p>This is the php file</p>
  <pre><code>&lt;?php
  
  if(!isset($_POST['submit']))
  {
      echo &quot;error; you need to submit the form!&quot;;
  }
  
  //Collect input
  $name = $_POST['name'];
  $home = $_POST['Home'];
  $city = $_POST['City'];
  $state = $_POST['State'];
  $zip_code = $_POST['Zip Code'];
  $country = $_POST['Country'];
  
  //Validate
  if(empty($home)||empty($city)||empty($state)||empty($zip_code)||empty(country))
  {
      echo &quot;Please enter all fields. (Name is Optional)&quot;;
  }
  
  
  
  $email_from = 'xxxx';
  $email_subject = &quot;New Submission&quot;;
  $email_body = &quot;New submission\nName:$name\nHome:$home\nCity:$city\nState:$state\nZip Code:$zip_code\nCountry:country&quot;
  $to =  &quot;xxxx&quot;;
  $headers = &quot;xxxx&quot;;
  
  //Send the email
  mail($to,$email_subject,$email_body);
  
  ?&gt;
  </code></pre>