title: Angularjs - Form Post Data Not Posted?
body: <p>I must admit I am a little bit confused... I have never done this before and I am apparently missing something</p>
  
  <p>When I pass data via http.post to my php file I am can't seem to collect data...</p>
  
  <p>Can someone tell me why this does not work?</p>
  
  <p>FormData gets displayed in console log,, and the file is being written for sure.. however it looks like no data is passed..</p>
  
  <pre><code>$scope.submitForm = function() {
      formData = $scope.form;
  
      $http.post('form2.php', JSON.stringify(formData)).success(function(){
  
          console.log(formData);
          //window.location.href = "form2.php?data=" + JSON.stringify(formData);
  
      });
  };
  </code></pre>
  
  <p>This is in my php file.. trying to write data from submitted form to a file... (just testing)..</p>
  
  <pre><code>    &lt;?php
  
          $file = 'form2.txt';
          $data = json_decode($_REQUEST['data'],true);
  
          //print( '&lt;pre&gt;' );
          //print_r ($data);
          //print( '&lt;/pre&gt;' );
  
          $data_insert = "Name: " . $data['firstname'] .
                      ", Email: " . $data['emailaddress'] . 
                      ", Description: " . $data['textareacontent'] . 
                      ", Gender: " . $data['gender'] . 
                      ", Is Member: " . $data['member'];
  
          //print $data_insert;
  
          file_put_contents($file, $data_insert, FILE_APPEND | LOCK_EX);
  
      ?&gt;
  </code></pre>