\n$header"; } $header = str_replace("\n","
",$header); if ($return[1]){ $body = $return[1]; }else{ $body = ""; } if ($content === 2){ if ($body){ $return = $body; }else{ $return = $header; } } if ($content === 1){ $return = $header; } if ($content === 3){ $return = "$header$body"; } if ($follow){ if (preg_match("/Location\:/","$header")){ $url = @explode("Location: ",$header); $url = $url[1]; $url = @explode("\r",$url); $url = $url[0]; $oldheader = str_replace("\r\n\r\n","",$header); $oldheader = str_replace("Location:","Location:",$oldheader); return open_page($url,$follow,$content,$post,$postdata); }else{ return $return; } }else{ return $return; } } $url = "http://php.net"; $follow = 1; $content = 2; $referrer = 0; $useragent = 0; $post = 0; $postdata = 0; print open_page($url,$follow,$content,$referrer,$useragent,$post,$postdata); ?>