<?php $file = fopen ("http://www.example.com/", "r"); if (!$file) { echo "<p>Unable to open remote file.\n"; exit; } else {blah blah blah; } fclose($file); ?>