title: Passing data from Angular form to PHP
body: <p>I am trying to save form data in Angular by ajax to store.php file. But, seems data is not properly fetched by file. Can someone point the mistakes? </p>
  
  <pre><code>&lt;form id="form1" post="content/store.php"&gt;
  
      &lt;div class="form-group"&gt;
          &lt;label for="examplename"&gt;Name&lt;/label&gt;
          &lt;input type="text" class="form-control" id="examplename" placeholder="Enter your name"&gt;
      &lt;/div&gt;
  
      &lt;div class="form-group"&gt;
          &lt;label for="exampleemail"&gt;Email&lt;/label&gt;
          &lt;input type="email" class="form-control" id="exampleemail" placeholder="Enter your email"&gt;
      &lt;/div&gt;
  
      &lt;button type="submit" class="btn btn-default" ng-click="submitting()" &gt;Submit&lt;/button&gt;          
  
  &lt;/form&gt;
  </code></pre>
  
  <p>ANGULAR SCRIPT: </p>
  
  <pre><code>var app = angular.module('myApp',[]);
  app.controller ('myCtrl',function($scope, $http){
      $scope.submitting = function(){
  
          var request = $http({
              method: "post",
              url: "localhost/content/store.php",
              data: {
                  email: $scope.email,
                  pass: $scope.password
              }
          });
  
          request.success(function (data) {
              alert("Successfully data entered! ");
          });
  
      }
  
  }); 
  </code></pre>
  
  <p>STORE.PHP</p>
  
  <pre><code>&lt;?php
    $postdata = file_get_contents("php://input");
    $request = json_decode($postdata);
    @$email = $request-&gt;email;
    @$pass = $request-&gt;pass;
    echo $email; 
  ?&gt;
  </code></pre>