How to retrieve http page from another host server with php and detect redirect

autherrap

New Member
Let's say I have a server at www.myhost.com. From there by using php I want to retrieve the html document that the php file www.anotherhost.com/somefile.php produces. I also want to use php to do this. anotherhost is not on the same server as myhost.I know that functions such as fopen, f_get_contents and file can do this by simply executing e.g.\[code\]$fp = fopen ("http://www.anotherhost.com/somefile.php")\[/code\]and from there fp can be used as any other file pointer to read the contents.BUT, for some reason I also want to know if somefile.php at anotherhost ordered a client-side redirect when I tried to retrieve somefile.php
 
Top