Posted June 2004

Simple example connecting to a remote server

Source Code

<?php
// http://www.php.net/fopen
$url = "http://www.google.com/";
$file = @fopen ($url, "r");
if (!$file) {
	echo "<p>Unable to connect to $url.</p>\n";
	exit;
} else {
	echo "<p>We connected to $url.</p>\n";
	exit;
	fclose($file);
}
?>