Using this form, users can find out all the urls of a website. It works well if the user submits a url. But if they submit a domain name, it doesn't work.
<?
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$url= $_POST["url"];
$data=file_get_contents($url);
$data = strip_tags($data,"<a>");
$d = preg_split("/<\/a>/",$data);
$count=1;
foreach ( $d as $k=>$u ){
if( strpos($u, "<a href=") !== FALSE ){
$u = preg_replace("/.*<a\s+href=\"/sm","",$u);
$u = preg_replace("/\".*/","",$u);
echo "<hr>".$count++.$u."\n";
}
}
}
?>
<html>
<body>
<form style="margin: 10px;" action="" method="post">
<label for="url">Enter a URL</label>
<input type="text" name="url" id="url">
<input type="submit" value="Go">
</form>
</body>
</html>
.htaccessfor that