<?php function fetchURL( $url ) { $host = $url_parsed[\"host\"]; $port = $url_parsed[\"port\"]; if ($port==0) $port = 80; $path = $url_parsed[\"path\"]; //if url is <a href='http://example.com' target='_blank'>http://example.com without final \"/\" //I was getting a 400 error $path=\"/\"; //redirection if url is in wrong format $host=\"www.somesite.com\"; $path=\"/404.shtml\"; endif; if ($url_parsed[\"query\"] != \"\") $path .= \"?\".$url_parsed[\"query\"]; $out = \"GET $path HTTP/1.0rnHost: $hostrnrn\"; $body = false; } return $in; } ?>