<form method="post"> <input type=text name="url" size=40><input type=submit value="Vis title"> </form> <br><br> <? function finn($url) { if(!preg_match("=://=", $url)) || ("Url ikke fullstendig"); $fh = @fopen("$url", "r"); if(!$fh) || ("Klarte ikke å koble til adressen"); $grabfile = fread($fh, 3000); preg_match("|]*>(.*) |siU", $grabfile, $title); echo $title; @fclose($fh); } if(!empty($url)) { finn($url); } ?>
Prøv det her.
Sindre Mathisen -2002