2
var myFunc = function(url){

        console.log(url);

          $http({
              url: "http://example.me/",
              method: "GET",
              data:{url:url},
          }).finally(function () {
})

Not sure why when I echo in my PHP $_GET['url'] I didn't get anything, is there anything wrong with the snytax above? btw I didn't get any error.

1 Answer 1

2

use "params", not "data", data is for POST or PUT method

$http({
   url: "http://example.me/",
   method: "GET",
   params:{url:url},
}).finally(function () {
Sign up to request clarification or add additional context in comments.

2 Comments

what a careles mistake! but my echo $_GET['url'] display nothing, any idea?
check in developer tools (F12 in chrome and FF) / network, if there is your request and what URL is it calling, is that url example.me/?url=SOMESTRING ?? or it is without params? Also try to disable cache to be sure you are using new version of your script, and add " cache: false" to yout $http params: $http({ url: "http://example.me/", method: "GET", params:{url:url}, cache: false })

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.