$top) die('Forbidden'); */ ?> Expecting </$expect> - found <$original_match>"); } else { $tags[] = $match; } echo "
"; echo htmlspecialchars("<$original_match>") . "
\n"; } if (array_key_exists('QUERY_STRING', $_SERVER) && preg_match('!^http://!', urldecode($_SERVER['QUERY_STRING']))) { $url = urldecode($_SERVER['QUERY_STRING']); echo "

$url

\n"; $page = fopen($url, 'r') or die("Cannot open URL"); while ($line = fgets($page, 4096)) $text .= $line; // no comment $text = preg_replace("//s","", $text); // onmouse $text = preg_replace('/onmouseover\="[^"]*"/s', '', $text); $text = preg_replace('/onmouseout\="[^"]*"/s', '', $text); $text = preg_replace('/onclick\="[^"]*"/s', '', $text); #die(htmlspecialchars($text)); preg_match_all('/<(.*?)>[^<]*?/sm', $text, $matches); $indent = 0; $color = true; $tags = array(); # a list of tags that you would expect to pair up $check = array('form', 'div', 'td', 'tr', 'table', 'a', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'html', 'head', 'body'); foreach ($matches[1] as $match) { if (preg_match('/^(' . implode('|', $check) . ').*/i', $match)) { $indent++; print_match($match); continue; } if (preg_match('/^\/(' . implode('|', $check) . ').*/i', $match)) { print_match($match); $indent--; continue; } } if ($indent > 0) die("

Premature end of tags!!!

"); } else { ?>

Please enter a valid http URL in the box below