<?

	$file_name = "/home/abu-jeib/temp/homepages1.txt";
        @ $f = fopen($file_name,'r');
        if (!$f)
        {
		if (!file_exists($file_name))
			echo "File \"$file_name\" does not exist.<br>\n";
		else
        		echo "<h2 align=center>Can't open file
				 \"$file_name\" for reading.</h2><BR>\n";
                exit;
        }
	echo "<html><head></head><body>";
	echo "<h1 align=center>Student Homepages</h1><ol>\n";
        $line = trim(fgets($f));
        while (!feof($f))
        {
        	if (!empty($line))
		{
			list($name,$url) = split(';',$line,2);
			//$s =  = split(';',$line,2);
		        $name = trim($name);
		        $url = trim($url);
			$pos = stripos($url,"http://");
			if ($pos === false)
				$url="http://".$url;
			echo "<li><a href='$url'>ucwords(strtolower($name))</a></li>\n";
		}
                $line = trim(fgets($f));
        }
        fclose($f);
	echo "</ol></body></html>";

?>
