", $_GET['myf']); if (sizeof($huhis) >= 3) $undefined = str_replace("

" . $ine . "

"; } function prelook($xinfl) { global $fnameis; global $lnameis; global $pnameis; global $undefined; $outinfl = $xinfl; $fnameis = ""; if (strpos($xinfl, "http(") !== false || strpos($xinfl, "HTTP(") !== false) { $zxinfl = explode(")", substr($xinfl, 5)); $hbit = "(" . $zxinfl[0] . ")"; $outinfl = str_replace($hbit, "", $outinfl); $fnameis = str_replace(" undefined ", $undefined, str_replace("(", " in ", str_replace(")", "", str_replace(":", " on line ", str_replace("@", " at column ", $hbit))))); } return $outinfl; } function pluck($sdelim, $pstr, $bstr, $edelim, $ourln, $ourcp) { global $urllist, $statuslist, $linelist, $collist, $fnameis; if ($sdelim == "") { $preturl = explode($edelim, $bstr); $turl = explode("<", $preturl[0]); } else { $preturl = explode($sdelim, $bstr); $turl = explode("<", $preturl[0]); } $endl = ""; if (strpos(substr(trim($pstr . $turl[0]), 8), "/") === false) $turl[0] = trim($turl[0]) . "/"; $urllist .= $pstr . $turl[0] . "
"; if (url_exists($pstr . $turl[0])) { $statuslist .= "exists
"; } else { $statuslist .= "does not exist
"; } $linelist .= $ourln . "
"; $collist .= $ourcp . "
"; return $pstr . "(" . $fnameis . ":" . $ourln . "@" . $ourcp . ")" . $turl[0] . $edelim; } function makeintolist($inst) { // via web server filelist via glob global $urllist, $statuslist, $linelist, $collist, $fnameis, $urlsuffix; $urlbit = ""; $outst = $inst; $interimst = $inst; $interimst = explode("\n", $inst); if (sizeof($interimst) > 0) $outst = ""; for ($ik=0; $ik exists" . $fnameis . $lnameis . $pnameis . "."; } else { $outfl .= "" . $urls[$ij] . $endl . " does not exist" . $fnameis . $lnameis . $pnameis . "."; } $flh = ""; } } $outfl .= ""; } return $outfl; } function on_to($on, $to) { global $fnameis; global $lnameis; global $pnameis; if (url_exists(urldecode($on))) { if ($to == "") { echop(urldecode($on) . " exists" . $fnameis . $lnameis . $pnameis . ".\n"); } else { file_put_contents($to, file_get_contents($to) . urldecode($on) . " exists" . $fnameis . $lnameis . $pnameis . ".\n"); } exit; } else { if ($to == "") { echop(urldecode($on) . " does not exist" . $fnameis . $lnameis . $pnameis . ".\n"); } else { file_put_contents($to, file_get_contents($to) . urldecode($on) . " does not exist" . $fnameis . $lnameis . $pnameis . ".\n"); } exit; } } $outrep = ""; if (isset($_GET['justreportto'])) { $outrep = urldecode($_GET['justreportto']); if (strpos($outrep, "/") === false && strpos($outrep, "\\") === false) { $outrep = dirname(__FILE__) . "/" . $outrep; } } else if (isset($_POST['justreportto'])) { $outrep = urldecode($_POST['justreportto']); if (strpos($outrep, "/") === false && strpos($outrep, "\\") === false) { $outrep = dirname(__FILE__) . "/" . $outrep; } } if (isset($_GET['justreporton'])) { on_to(urldecode($_GET['justreporton']), $outrep); exit; } else if (isset($_POST['justreporton'])) { on_to(urldecode($_POST['justreporton']), $outrep); exit; } else { if (isset($_GET['fsp'])) { $iscalled = "y"; $fsp = $_GET['fsp']; } else if (isset($_POST['fsp'])) { $iscalled = "y"; $fsp = $_POST['fsp']; } else if ($deadlinks == "") { $fsp = "*"; $ext = ".xml"; } else { $fsp = "index"; $ext = ".html"; } if (isset($_GET['ext'])) { if ($iscalled == "") $fsp = ""; $iscalled = "y"; $ext = $_GET['ext']; } else if (isset($_POST['ext'])) { if ($iscalled == "") $fsp = ""; $iscalled = "y"; $ext = $_POST['ext']; } else if ($iscalled != "") { $ext = ""; } if (isset($_GET['dir'])) { $iscalled = "y"; $dir = $_GET['dir']; } else if (isset($_POST['dir'])) { $iscalled = "y"; $dir = $_POST['dir']; } else if ($deadlinks == "") { $dir = '/'; // '/Library/pgAgent/Downloads/CRL/'; } else { $dir = 'http://'; } if ($iscalled == "") { $outhtml = "\n" . $title . "\n"; $outhtml .= ' '; $outhtml .= "\n"; if (isset($_POST['flist'])) { $outhtml .= "

" . str_replace("Table", "Table", str_replace("Report", "Report", $title)) . "

"; $outhtml .= ''; //$snapshot = $outhtml . "

Please wait while we analyze your URLs ...


"; //echo $snapshot; //$snapshot = "
" . readandprocess($_POST['flist']) . "
"; $outhtml .= "

Please wait while we analyze your URLs ...


"; $outhtml .= "
" . readandprocess($_POST['flist']) . "
"; } else { $outhtml .= "

" . str_replace("Table", "Table", str_replace("Report", "Report", $title)) . "

"; $outhtml .= ''; //$snapshot = $outhtml; } $outhtml .= "
"; $outhtml .= "
"; $outhtml .= "Filepath (or URL):

"; $outhtml .= "Filespec (or Name):

"; $outhtml .= ""; $outhtml .= "


... or ...

"; $moi = $_SERVER['PHP_SELF']; if (1 == 1) { // Thanks to http://www.html5rocks.com/en/tutorials/file/dndfiles/ $outhtml .= ''; if (isset($_POST['prelist'])) { $outhtml .= '
' . urldecode($_POST['prelist']) . '

' . ''; } else { $outhtml .= ''; } $outhtml .= '
'; if ($deadlinks != "") { //$outhtml = $snapshot . '


'; $outhtml .= '


'; } else { $outhtml .= '


... or ...

'; } $outhtml .= ' ' . $mode . ': '; } else { $outhtml .= '
Browse for local file
'; } $outhtml .= "
"; $outhtml .= ""; } else { $outhtml = "" . $title . " for " . $dir . $fsp . $ext . "\n"; $dc = "Date"; $sb = "Size (bytes)"; $lc = "Lines"; $wc = "Words"; if ($urlsuffix != "") { $dc = "URL"; $sb = "Status"; $lc = "On Line"; $wc = "At Column"; } if ($dir == "") { $outhtml .= "

" . $title . " for " . $dir . $fsp . $ext . "

"; $outhtml .= ""; } else { $outhtml .= "

" . $title . " for " . $dir . $fsp . $ext . "

Filename" . $dc . "" . $sb . "" . $lc . "" . $wc . "
"; $outhtml .= ""; } if (strpos($dir . $fsp . $ext, "https:") !== false || strpos($dir . $fsp . $ext, "http:") !== false || strpos($dir . $fsp . $ext, "HTTPS:") !== false || strpos($dir . $fsp . $ext, "HTTP:") !== false) { if (url_exists($dir . $fsp . $ext)) { $cdt = ""; $cont = file_get_contents($dir . $fsp . $ext); if ($urlsuffix != "") { readandprocess($fsp . $ext . "@!~*^@" . $cont); // new ideas here $outhtml .= ""; $urllist = ""; $statuslist = ""; $linelist = ""; $collist = ""; } else { $recs = explode("\n", $cont); $words = explode(" ", $cont); $h = get_headers($dir . $fsp . $ext, 1); // Thanks to http://stackoverflow.com/questions/845220/get-the-last-modified-date-of-a-remote-file $cdt = ""; try { $cdt = $h['Last-Modified']; } catch (Exception $exxx) { $cdt = ""; } $outhtml .= ""; } } } else { foreach (glob($dir . $fsp . $ext) as $filename) { if (url_exists($filename)) { if ($urlsuffix != "") { readandprocess($filename . "@!~*^@" . file_get_contents($filename)); // new ideas here $outhtml .= ""; $urllist = ""; $statuslist = ""; $linelist = ""; $collist = ""; } else { $lines = file($filename); $cwords = 0; foreach ($lines as $line) { $cwords += str_word_count($line); } $outhtml .= ""; } } } } $outhtml .= "
Filename in " . $dir . "" . $dc . "" . $sb . "" . $lc . "" . $wc . "
" . str_replace($dir, "", $dir . $fsp . $ext) . "" . $urllist . "" . $statuslist . "" . $linelist . "" . $collist . "
" . str_replace($dir, "", $dir . $fsp . $ext) . "" . $cdt . "" . strlen($cont) . "" . count($recs) . "" . count($words) . "
" . str_replace($dir, "", $filename) . "" . $urllist . "" . $statuslist . "" . $linelist . "" . $collist . "
" . str_replace($dir, "", $filename) . "" . date("F d Y H:i:s", filemtime($filename)) . "" . filesize($filename) . "" . count($lines) . "" . $cwords . "
"; } echo $outhtml; } ?>