title: Cannot POST data - Ionic Framework
body: <p>I have created a small application in which i am posting just one field name district in database using php mysql - my app.js file has code -</p>
  
  <pre><code>angular.module('todo', ['ionic'])
  .controller('TodoCtrl', function($scope,$http) {
  $scope.insertdata = function(){
  console.log($scope.district);
  $http.post('insert.php',{'district':$scope.district})
  .success(function(data)
  {
  console.log("Done");
  })
  } });
  </code></pre>
  
  <p>and index.html has</p>
  
  <pre><code>&lt;body ng-app="todo" ng-controller="TodoCtrl"&gt;
  &lt;form&gt;
  &lt;input type="text" ng-model="district"/&gt;
  &lt;input type="button" value="submit" ng-click="insertdata()"/&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>and insert.php has:</p>
  
  <pre><code>$data = json_decode(file_get_contents("php://input"));
  $districtname = mysql_escape_string($data-&gt;district);
  mysql_connect("localhost","root","");
  mysql_select_db("test");
  mysql_query("Insert into districtapp (districtname) Values ('".$districtname."')");
  </code></pre>
  
  <p>I have installed codova whitelist and added these lines :</p>
  
  <pre><code>&lt;access origin="*"/&gt;
  &lt;allow-navigation href="http://*/*" /&gt;
  &lt;allow-navigation href="https://*/*" /&gt;
  &lt;allow-navigation href="data:*" /&gt;
  </code></pre>
  
  <p>I run app by ionic serve and get :</p>
  
  <p>Error : POST <a href="http://192.168.2.152:8100/insert.php" rel="nofollow">http://192.168.2.152:8100/insert.php</a> 404 Not Found</p>
  
  <p>Can anyone please help me to solve this Posting issue?</p>