Remote Files

RJM Programming - March, 2023



"; $uval=""; $tval=""; $cval=""; $oval="1"; $blurb=""; $pblurb=""; $cfor="For "; $title=""; $pregt="@\(.*)\@i"; $matcho=1; $curo=0; if (isset($_POST['url']) && $_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'])) . " "; $uval=str_replace("+"," ",urldecode($_POST['url'])); $cfor="for "; } else if (isset($_GET['url']) && $_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'])) . " "; $uval=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']) && $_POST['type'] != '') { $pregt="@\\<" . str_replace("+"," ",urldecode($_POST['type'])) . "\\>(.*)\\@i"; $pregt="@\\>(.*)\\@i"; $tval=str_replace("+"," ",urldecode($_POST['type'])); $pblurb.=$cfor . str_replace("+"," ",urldecode($_GET['type'])) . " element "; $cfor=" "; } else if (isset($_GET['type']) && $_GET['type'] != '') { $pregt="@\\<" . str_replace("+"," ",urldecode($_GET['type'])) . "\\>(.*)\\@i"; $pregt="@\\>(.*)\\@i"; $tval=str_replace("+"," ",urldecode($_GET['type'])); $pblurb.=$cfor . str_replace("+"," ",urldecode($_GET['type'])) . " element "; $cfor=" "; } else { $pregt="@\(.*)\@i"; $cfor.="title " . " element "; } if (isset($_POST['ord']) && $_POST['ord'] != '') { $matcho=intval(str_replace("+"," ",urldecode($_POST['ord']))); $oval="$matcho"; $pblurb.=$cfor . "number " . $matcho . " ...
"; } else if (isset($_GET['ord']) && $_GET['ord'] != '') { $matcho=intval(str_replace("+"," ",urldecode($_GET['ord']))); $oval="$matcho"; $pblurb.=$cfor . "number " . $matcho . " ...
"; } else { $matcho=1; $cfor.="number " . $matcho . " ...
"; } if (isset($_POST['containing']) && $_POST['containing'] != '') { if ($pregt == "@\(.*)\@i") { $pregt="@\\>(.*)" . str_replace("+"," ",urldecode($_POST['containing'])) . "\\","",$pblurb); if ($tval == "") { $pblurb=str_replace(" numbering up to 1 "," in unlimited search ",str_replace(" number "," numbering up to ",$pblurb)); } $pblurb=str_replace(" numbering up to 1 "," in unlimited search ",$pblurb) . " containing " . str_replace("+"," ",urldecode($_POST['containing'])). " ...
"; $cfor=" "; } else if (isset($_GET['containing']) && $_GET['containing'] != '') { if ($pregt == "@\(.*)\@i") { $pregt="@\\>(.*)" . str_replace("+"," ",urldecode($_GET['containing'])) . "\\","",$pblurb); if ($tval == "") { $pblurb=str_replace(" numbering up to 1 "," in unlimited search ",str_replace(" number "," numbering up to ",$pblurb)); } $pblurb=str_replace(" numbering up to 1 "," in unlimited search ",$pblurb) . " containing " . str_replace("+"," ",urldecode($_GET['containing'])). " ...
"; $cfor=" "; } //echo str_replace('<','<',str_replace('>','>',$pregt)); //exit; if (!$file) { echo "

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)) { if ($cval == "") { $title = $out[1]; } else if ($title == "") { $title .= $out[1] . $cval; } else { $title .= "
" . $out[1] . $cval; } $curo++; if ($curo >= $matcho) { $blurb=str_replace(" numbering up to 1 containing "," in unlimited search containing ",$pblurb); if ($cval != "" && $tval == "" && $matcho == 1) { $curo=$curo; } else { break; } } } } fclose($file); $postblurb="








"; echo "Remote Files - RJM Programming - March, 2023${preblurb}

${blurb}${title}

${postblurb}"; exit; ?>