'cURL not redirecting to correct url
I am writing a php code to trace ulr redirects using cUrl but is badly stuck on one point
What i do is take urls in an array , pass it to function and gets redirect links but with one of the url
"https://c.duomai.com/track.php?site_id=264419&aid=4598&euid=220520a5217713c8ee56ed&t=https%3A%2F%2Fwww.samsclub.com%2F"
when i send it as first item in array cUrl goes to right webpage and finds url but when this url is at any other location then first item in row it treats this url differently and gives error page ,
i have tried url encoding , removed white space everything but nothing is helping
code :
$handle = curl_init($url);
curl_setopt($handle, CURLOPT_HEADER, TRUE);
curl_setopt($handle, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($handle, CURLOPT_USERAGENT, $user_agent);
$response = curl_exec($handle);
$httpCode = curl_getinfo($handle, CURLINFO_HTTP_CODE);
$newquery_get = htmlentities($response);
curl_close($handle);
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
