View Single Post
Old 11-29-2006, 03:22 AM  
darksoul
Confirmed User
 
darksoul's Avatar
 
Join Date: Apr 2002
Location: /root/
Posts: 4,997
Here it is
Code:
<?php
if($dir = opendir(".")) {
	while (($file = readdir($dir)) !== false) {
		if($file != "." && $file != ".." &&
		   $file != basename(__file__) &&
		    preg_match("/^.*\.php$/",$file)) {
			$text .= "<a href=\"$file\">";
			$text .= str_replace("-"," ",str_replace(".php","",$file));
			$text .= "</a><br>\n";
		}
	}
}
$fd = fopen("outputfile.html","w");
fwrite($fd,$text);
fclose($fd);
echo "Job done";
?>
Modifyed it to only look for .php files and exclude itself
also removed the ".php" from the title
__________________
1337 5y54|)m1n: 157717888
BM-2cUBw4B2fgiYAfjkE7JvWaJMiUXD96n9tN
Cambooth
darksoul is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote