How would I get edit function with Json to redirect to another page with Angular js <p>I am having an issue were when i click edit the data only shows up on the same page not sure how to get it to redirect and show up on another page.</p> <p>controller partial code just the edit and update function </p> <pre><code>/** function to edit product details from list of product referencing php **/ $scope.prod_edit = function(index) { $scope.update_prod = true; $scope.add_prod = false; $http.post('db.php?action=edit_product', { 'prod_index' : index } ) .success(function (data, status, headers, config) { //alert(data[0]["prod_name"]); $scope.prod_id = data[0]["id"]; $scope.prod_name = data[0]["prod_name"]; $scope.prod_desc = data[0]["prod_desc"]; $scope.prod_price = data[0]["prod_price"]; $scope.prod_quantity = data[0]["prod_quantity"]; }) .error(function(data, status, headers, config){ }); } /** function to update product details after edit from list of products referencing php **/ $scope.update_product = function() { $http.post('db.php?action=update_product', { 'id' : $scope.prod_id, 'prod_name' : $scope.prod_name, 'prod_desc' : $scope.prod_desc, 'prod_price' : $scope.prod_price, 'prod_quantity' : $scope.prod_quantity } ) .success(function (data, status, headers, config) { $scope.get_product(); alert("Product has been Updated Successfully"); }) .error(function(data, status, headers, config){ }); } }); </code></pre> <p>db.php </p> <pre><code>/** Function to Edit Product **/ function edit_product() { $data = json_decode(file_get_contents("php://input")); $index = $data-&gt;prod_index; $qry = mysql_query('SELECT * from product WHERE id='.$index); $data = array(); while($rows = mysql_fetch_array($qry)) { $data[] = array( "id" =&gt; $rows['id'], "prod_name" =&gt; $rows['prod_name'], "prod_desc" =&gt; $rows['prod_desc'], "prod_price" =&gt; $rows['prod_price'], "prod_quantity" =&gt; $rows['prod_quantity'] ); } print_r(json_encode($data)); return json_encode($data); } /** Function to Update Product **/ function update_product() { $data = json_decode(file_get_contents("php://input")); $id = $data-&gt;id; $prod_name = $data-&gt;prod_name; $prod_desc = $data-&gt;prod_desc; $prod_price = $data-&gt;prod_price; $prod_quantity = $data-&gt;prod_quantity; // print_r($data); $qry = "UPDATE product set prod_name='".$prod_name."' , prod_desc='".$prod_desc."',prod_price='.$prod_price.',prod_quantity='.$prod_quantity.' WHERE id=".$id; $qry_res = mysql_query($qry); if ($qry_res) { $arr = array('msg' =&gt; "Product Updated Successfully!!!", 'error' =&gt; ''); $jsn = json_encode($arr); // print_r($jsn); } else { $arr = array('msg' =&gt; "", 'error' =&gt; 'Error In Updating record'); $jsn = json_encode($arr); // print_r($jsn); } } ?&gt; </code></pre> <p>The page i need it to redirect is <a href="http://localhost/angular_php/create_update.php" rel="nofollow">http://localhost/angular_php/create_update.php</a></p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html ng-app="listpp" ng-app lang="en"&gt; &lt;head&gt; &lt;meta charset="utf-8"&gt; &lt;link href="assets/css/bootstrap.min.css" rel="stylesheet"&gt; &lt;style type="text/css"&gt; ul&gt;li, a{cursor: pointer;} &lt;/style&gt; &lt;title&gt;Angular With PHP&lt;/title&gt; &lt;script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.6/angular.min.js"&gt; &lt;/script&gt; &lt;script src="controller.js"&gt;&lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;?php include "templates/header.php";?&gt; &lt;br&gt;&lt;br&gt; &lt;div ng-controller="maincontroller"&gt; &lt;div class="wrapper"&gt; &lt;div class="container col-sm-8 col-sm-offset-2"&gt; &lt;div class="page-header"&gt; &lt;h4&gt;Add/Update Product&lt;/h4&gt; &lt;/div&gt; &lt;form class="form-horizontal" name="add_product" &gt; &lt;input type="hidden" name="prod_id" ng-model="prod_id"&gt; &lt;div class="form-group"&gt; &lt;label for="firstname" class="col-sm-2 control-label"&gt;Prod Name&lt;/label&gt; &lt;div class="col-sm-3"&gt; &lt;input type="text" class="form-control" name="prod_name" ng-model="prod_name" placeholder="Enter Product Name"&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="form-group"&gt; &lt;label for="lastname" class="col-sm-2 control-label"&gt;Prod Desc&lt;/label&gt; &lt;div class="col-sm-3"&gt; &lt;input type="text" class="form-control" name="prod_desc" ng-model="prod_desc" placeholder="Enter Product Description"&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="form-group"&gt; &lt;label for="lastname" class="col-sm-2 control-label"&gt;Prod Price&lt;/label&gt; &lt;div class="col-sm-3"&gt; &lt;input type="text" class="form-control" name="prod_price" ng-model="prod_price" placeholder="Enter Product Price"&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="form-group"&gt; &lt;label for="lastname" class="col-sm-2 control-label"&gt;Prod Quantity&lt;/label&gt; &lt;div class="col-sm-3"&gt; &lt;input type="text" class="form-control" name="prod_quantity" ng-model="prod_quantity" placeholder="Enter Product Quantity"&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="form-group"&gt; &lt;div class="col-sm-offset-2 col-sm-10"&gt; &lt;button type="submit" class="btn btn-default" name="submit_product" ng-show='add_prod' value="Submit" ng-click="product_submit()"&gt;Submit&lt;/button&gt; &lt;button type="submit" class="btn btn-default" name="update_product" ng-show='update_prod' value="Update" ng-click="update_product()"&gt;Update&lt;/button&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/form&gt; &lt;/div&gt; &lt;/div&gt; &lt;script src="assets/js/ui-bootstrap-tpls-0.10.0.min.js"&gt;&lt;/script&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>