View Single Post
Old 05-22-2008, 11:40 PM  
pr0
rockin tha trailerpark
 
pr0's Avatar
 
Industry Role:
Join Date: May 2001
Location: ~Coastal~
Posts: 23,088
Quote:
Originally Posted by GrouchyAdmin View Post
bich i cut u

Code:
<html>
<head>
<Title>404 Test Thingy from hell</title>
</head>
<body bgcolor="#ffffff" text="#000000" link="#0000ff">
<br>
<form method="post">
  <div align="center"><strong>Test URLs:</strong><br>
      <textarea name="urls" id="urls" cols="45" rows="5"><?=isset($_REQUEST['urls'])?$_REQUEST['urls']:"";?></textarea>
    <br>
    <input type="submit" name="submit" id="submit" value="Check Response">
  </div>
</form>
<?php
// BE SAFE: WRAP YOUR CRAP!
if (!function_exists('findCurlCli')) {
  function findCurlCli() {
    $curlClis=array(
                  '/usr/bin/curl', '/usr/local/bin/curl',
                  '/usr/bin/curl-cli', '/usr/local/bin/curl-cli',
                  '/usr/bin/curlcli', '/usr/local/bin/curlcli',
                  '/usr/bin/curl-cli', '/usr/local/bin/curl-cli',
                  // FOR SOME REASON THIS DOESNT WORK!!!!!
                  // '/usr/bin/wget', '/usr/local/bin/wget'
                  );

    foreach ($curlClis as $curlcli) {
      if (@is_file("$curlcli") && is_executable("$curlcli")) {
          return("$curlcli");
          break;
      } else {
         return FALSE;
      }
    }
  }
}
// lol
if ($foundCurl = findCurlCli()) {
  $myurls = (isset($_REQUEST['urls'])?explode("\n", trim($_REQUEST['urls'])): array());
  foreach ($myurls as $url) {
    // escapeshellcmd is for pussies and communists.
    $data = system("$foundCurl -I $url | grep -v '404'");
      if ($data = "1") {
        echo "<font color='red'>404</font>: <a href='$url' target='_new'>[link]</a> $url<br>\n";
      }
    }
  }
}
?>
</body>
</html>
wait is this thing checking it the way i suggested for a certain text area?
pr0 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote