My Goal... to process all redirects serverside and simply return the LP url to the client so that no visibility occurs during redirection.
Code: Select all
$ch2 = curl_init();
curl_setopt($ch2,CURLOPT_URL,$url);
curl_setopt($ch2, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch2,CURLOPT_POST,'');
curl_setopt($ch2,CURLOPT_POSTFIELDS,'');
curl_exec($ch2);
curl_close($ch2);util_redirect(get_final_url($url)); at the end...
Code: Select all
function get_final_url($url){
global $final_host;
$redirects = get_all_redirects($url);
if (count($redirects)>0){
$final_url = array_pop($redirects);
if(substr($final_url,0,7) != 'http://' && !empty($final_host))
{ $final_url = 'http://'.$final_host.$final_url; }
return $final_url;
} else {
return $url;
}Any help