// Submit button pressed? if ( isset($_POST["submit"]) ) { $ch = curl_init(); curl_setopt ($ch, CURLOPT_URL, $_POST["refurl"] ); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt ($ch, CURLOPT_HEADER, 0); $result=curl_exec ($ch); $badpath = pathinfo(parse_url($_POST["badurl"], PHP_URL_PATH), PATHINFO_BASENAME); $badquery = parse_url($_POST["badurl"], PHP_URL_QUERY); $badurlpath = $badpath . (empty($badquery) ? "": "?".$badquery); if ( !empty($result) and !strpos($result ,"This URL does not exist") and strpos($result, $badurlpath) and !strpos($_POST["badurl"], "mailto:abuse") ) { $hostname = parse_url($_POST["badurl"], PHP_URL_HOST); $domainarr = explode(".", $hostname); $ct = count($domainarr); if ($ct > 2) { $ctt = $ct - 3; $domain = strtolower($domainarr[$ctt]); } else { $domain = "nrao"; // we can't figure this out, should not happen } switch ($domain) { case gb: // print "GB"; $email = "wbaudler@nrao.edu"; break; case cv: // print "CV"; $email = "pmurphy@nrao.edu"; break; case aoc: // print "AOC"; $email = "switz@nrao.edu"; break; case vla: // print "VLA"; $email = "switz@nrao.edu"; break; case vlba: // print "VLBA"; $email = "switz@nrao.edu"; break; case archive: // print "archive"; $email = "switz@nrao.edu"; break; case tuc: // print "tuc"; $email = "jmangum@nrao.edu"; break; case casa: // print "casa"; $email = "jott@nrao.edu"; break; default: // print "default"; $email = "pmurphy@nrao.edu"; break; } mail($email, "Dead Link", "machine: " . $_POST["machine"] . "\n" . "badurl: " . $_POST["badurl"] . "\n" . "refurl: " . $_POST["refurl"] . "\n" . "email: " . $_POST["email"] . "\n" . "comments:\n\n" . $_POST["comments"] . "\n\n" . "PROTOCOL: " . $_SERVER["SERVER_PROTOCOL"] . "\n" . "REMOTE IP: " . $_SERVER["REMOTE_ADDR"] . "\n" . "Debug: hostname=" . $hostname . "\n", // " ct=" . $ct . "\n" . // " ctt=" . $ctt . "\n" . // " domain=" . $domain . "\n" , empty($_POST["email"]) ? "" : "Reply-To: " . $_POST["email"] . "\r\n" ); include_once "nrao-header.html"; print "
Your error report has been sent.
"; print "It should be fixed shortly. Thank you.
"; # for testing only, remove for production print ""; include_once "nrao-trailer.html"; include_once "nrao-end.html"; } // else // { print "Nasty spammer."; // } curl_close ($ch); } else { include_once "nrao-header.html"; print "You have encountered a dead link or another problem with this NRAO web server. Please submit a short bug report including the URL that caused this error to show up. Note: If you want feedback about this problem, you have to enter your email address as well. According to our privacy policy, your email address will only be used to address this problem. Thanks. |
Most likely the page was moved/removed a while ago. You may want to contact the owner"; print " of the page that sent you here that his/her page contains outdated links."; ?>
Your browser:
print $_SERVER["HTTP_USER_AGENT"]; ?>
Bad URL:
print "http://".$_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]; ?>
Referring URL:
print $_SERVER["HTTP_REFERER"]; ?>
The URL you typed does not exist. Please check that you typed your URL correctly."; } include_once "nrao-trailer.html"; include_once "nrao-end.html"; } ?>