I'm trying to read the query string (which is alphanumeric) on load the page using angular js and send it to php side. But somehow it reads only integer. Here is my code:
URL:
Angular JS Code:
App.controller('reset',['Auth','$scope','$location','$http',function (Auth,$scope,$location,$http) {
$scope.init = function () {
$scope.token = $location.search().token;
$http.post('controller/reset.php',$scope.token).success(function(data){
alert('success = '+data);
}).error(function(e){
alert('error in request');
})
}
$scope.init();
}])
PHP Code:
<?php
$data = json_decode(file_get_contents("php://input"));->data;
echo '<pre>';print_r($data);
?>
I'm alerting the data coming from PHP and it comes success=5 while it should show me success=5c1a45c
I can't find the reason why it behaves like this while I'm using the same method to validate the login and works fine.
Can anyone please help me to fill the gap.
Thanks in advance.