I have a factory service in Angular that is successfully posting my email in the HTTP request which I have verified with Firebug, but the email is not being seen by my PHP file. I am reaching my PHP file since I can echo a response from it, but the email value I sent it is not being received as I have already mentioned.
Controller (partial):
$scope.subscribe = function() {
if($scope.email.length > 0) {
Subscribe.save({},$scope.email);
} else {
alert("Please enter your email address");
}
}
Factory:
app.factory('Subscribe', ['$resource', function($resource) {
return $resource( 'server/restdb.php:email',
{email: '@email'},
{
}
);
}]);
PHP:
<?php
echo 'email: '.$_REQUEST['email'];
I have also tried using $_POST
to get the email as well.
So to recap:
- Posts email in HTTP request successfully.
- PHP file is being accessed and getting response from it.
- PHP not receiving the email value I sent it.