1

I want to receive date and send it to the php file

$http.post('views/php.php', {
  item: $scope.email
})
.success(function(data) {
  console.log(data);
});

but console log says

POST http://localhost:9000/views/php.php 404 (Not Found)

However if I go the link it shows and starts downloading.

Why does this happen?

7
  • because that file is not available there, as 404 does mean that Commented Apr 29, 2015 at 7:50
  • @pankajparkar it is available there but gives me error not found Commented Apr 29, 2015 at 7:51
  • @pankajparkar I searched I found this people have the same issue stackoverflow.com/questions/26934635/… Commented Apr 29, 2015 at 7:52
  • What are the contents of the file? Is the php code in the file throwing the error, perhaps? Commented Apr 29, 2015 at 8:00
  • 1
    POST (what you are doing in angular) is different form GET (clicking on the link) Commented Apr 29, 2015 at 10:08

1 Answer 1

1

You are not running it on apache that's why its downloading! You are running it on npm server WhIch cannot interpret PHP. Run it from xampp's it should work fine .

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.