title: Cannot POST in AngularJS and PHP (error 404)
body: <p>I'm trying to send information to a PHP page, but it returns me a 404 error status.</p>
  
  <pre><code>&lt;form name="registerForm" novalidate&gt;
      &lt;div class="field"&gt;&lt;label for="name"&gt;name : &lt;/label&gt;&lt;input type="text" ng-model="register.registerInfo.name" name="name" id="name" autocomplete="off" required &gt;&lt;/div&gt;
      &lt;div class="field"&gt;&lt;label for="number"&gt;number : &lt;/label&gt;&lt;input type="text" ng-model="register.registerInfo.number" name="number" id="number" autocomplete="off" required &gt;&lt;/div&gt;
      &lt;br&gt;
      &lt;button ng-click='registerForm.$valid &amp;&amp; register.register()'&gt;send&lt;/button&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>A part of app.js, I'm using ngrouting</p>
  
  <pre><code>    .controller('RegisterCtrl', ['$http', function($http){
  
      this.registerInfo = {
          name: '',
          number: ''
      };
  
      this.register = function() {
          var data = {
              name: this.registerInfo.name,
              number: this.registerInfo.number
          };
  
          $http.post('register.php', data).then(function(data) {
              console.log(data);
          }, function(error) {
              console.error(error);
          });
      };
  }]);
  </code></pre>
  
  <p>register.php</p>
  
  <pre><code>&lt;?php 
  
  $data = json_decode(file_get_contents('php://input'));
  echo 'slt';
  echo $data-&gt;data-&gt;name;
  </code></pre>
  
  <p><a href="http://puu.sh/m4FVO/3e607fd137.png" rel="nofollow noreferrer">http://puu.sh/m4FVO/3e607fd137.png</a></p>
  
  <pre><code>│   404.html
  │   favicon.ico
  │   index.html
  │   robots.txt
  │
  ├───images
  │       yeoman.png
  │
  ├───scripts
  │   │   app.js
  │   │   connection.php
  │   │   register.php
  │   │
  │   └───controllers
  ├───styles
  │       main.css
  │       style.css
  │
  └───views
          contact.html
          main.html
  </code></pre>
  
  <p>I want to send register information (the name and a number), analyze data in PHP and if they are okay save them with MySQL. I don't know why it can't find register.php since the path seems correct, maybe an issue with the server?</p>