$redirect_url = redirects to another site that verifies that a user has a cookie. If they are cookied than it redirects back to the original site.
This is my code:
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $redirect_url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 2);
curl_setopt($ch, CURLOPT_MAXREDIRS, 10);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
$output = curl_exec($ch);
curl_close($ch);
This does not seem to work. When I print $output than it shows the redirect site if they haven’t been cookied.
BTW this works but causes an infinite loop. That is why I am trying to replace this with the curl function.
<iframe src="'. $redirect_url . '" height="0px" width="0px" style="visibility:hidden;"></iframe>