<?
header ("Content-type:text/plain");

$tab=(array) null;

/*$dir = opendir (".");
while (false !== ($file = readdir($dir))) if (strpos($file, '.php',1))  $tab[count($tab)]="./$file";
*/

$out=exec("ls") or die("error");
print $out;
$tab=explode("\n",$out);

print_r($tab);

return;

//$tab[0]="/home/fabrice/public_html/molecule-gene.php";

for ($i=0;$i<count($tab);$i++)
{
// print "==>".$tab[$i]."\n";
//$A=str_replace("./","",$tab[$i]);


$handle=fopen($tab[$i],"r");

$content="";
while (!feof($handle)) $content.=trim(fgets($handle,8192));
fclose($handle);



/////////EXPRESSION MATCH URL href =

$content=str_replace("target=\"_blank\"","",$content);
$content=str_replace("\\\"","\"",$content);


$RegEx = '#<[aA](\s)*(href|HREF)(\s)*=(\s)*[\"|\'](.*?)[\"|\'](.*?)>#is';  
preg_match_all($RegEx,$content,$res,PREG_PATTERN_ORDER);  
//print $content."<br>";


foreach ($res[5] as $key => $val)
{
if (!strpos($val,'.php')) continue;

$t=explode("?",$val);
$val=$t[0];




print "$A\t$val\n";
}


//print $content."<br>";




//break;
}






?>