Este ejemplo creo q te ira bien, un saludo.
Código PHP:
<form method="post">
<input type="text" name="url" value="http://">
<input type="Submit" value="Ver código">
</form>
<?
if ($_POST['url']== "http://"){
echo "Por favor rellena la url";
}else if ($_POST['url']==""){
echo "Debes incluir el http://";
}else{
$fichero=fopen($_POST['url'],'r');
if ($fichero)
{
$string ="";
while (!feof($fichero)){
$string .=fgets($fichero,512);
}
echo "<textarea cols='80' rows='30'>";
echo $string;
echo "</textarea>";
}else{
echo "No se ha podido habrir el fichero";
}
}
?>