I have created an ionic app for client management. I'm trying to add a mail function (PHP script on server) that can be called from the client.
I have created a javascript function calling the PHP script. As far as i can tell that works, it gives 200 OK response. My problem is that the data being returned is the HTML of the page from were i use the javascript function.
This is the javascript function:
$http({url : '#/php/mailer.php',
method: "POST",
data: {email: "test@test.test"}
}).success(function(data, status, headers, config){
console.log(data);
console.log(status);
console.log(headers);
console.log(config);
}).error(function(data, status, headers, config){
console.log("Something went wrong ");
});
Simple PHP for testing:
<?php
echo "test";
?>
Fixed the problem: url was wrong, deleted the # and made sure the url of the php script was correct
I feel like a giant noob now :(