If you're using curl, you can try the following:
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
If you still aren't getting past the loading page, its possible its not an http redirect.
In that case you'll have to manually parse the target location. A lot of websites use a meta refresh tag for such loading pages. Look for something similar to the following:
<meta http-equiv="refresh" content="5; url=http://example.com/" />
You can easily parse the above with regex or any dom parsing library for php.
window.location in the source code.