(.*)\@i"; $matcho=1; $curo=0; if (isset($_POST['url'])) { $file = fopen ("http:" . str_replace("http:","",str_replace("https:","",str_replace("+"," ",urldecode($_POST['url'])))), "r"); $pblurb="Looking in " . str_replace("+"," ",urldecode($_POST['url'])) . " "; $cfor="for "; } else if (isset($_GET['url'])) { $file = fopen ("http:" . str_replace("http:","",str_replace("https:","",str_replace("+"," ",urldecode($_GET['url'])))), "r"); $pblurb="Looking in " . str_replace("+"," ",urldecode($_GET['url'])) . " "; $cfor="for "; } else { $file = fopen ("http://www.rjmprogramming.com.au/index.php", "r"); $cfor="Looking in " . "http://www.rjmprogramming.com.au/index.php" . " for "; } if (isset($_POST['type'])) { $pregt="@\\<" . str_replace("+"," ",urldecode($_POST['type'])) . "\\>(.*)\\" . str_replace("+"," ",urldecode($_POST['type'])) . "\\>@i"; $pregt="@\\>(.*)\\" . str_replace("+"," ",urldecode($_POST['type'])) . "\\>@i"; $pblurb.=$cfor . str_replace("+"," ",urldecode($_GET['type'])) . " element "; $cfor=" "; } else if (isset($_GET['type'])) { $pregt="@\\<" . str_replace("+"," ",urldecode($_GET['type'])) . "\\>(.*)\\" . str_replace("+"," ",urldecode($_GET['type'])) . "\\>@i"; $pregt="@\\>(.*)\\" . str_replace("+"," ",urldecode($_GET['type'])) . "\\>@i"; $pblurb.=$cfor . str_replace("+"," ",urldecode($_GET['type'])) . " element "; $cfor=" "; } else { $pregt="@\
Unable to open remote file.\n"; exit; } while (!feof ($file)) { $line = fgets ($file, 1024); /* This only works if the title and its tags are on one line */ if (preg_match ($pregt, $line, $out)) { $title = $out[1]; $curo++; if ($curo >= $matcho) { $blurb="$pblurb"; break; } } } fclose($file); echo "
${blurb}${title}
"; exit; ?>