Hi there… I have this code
[code=php]
<link href=”main.css” rel=”stylesheet” type=”text/css”>
<?
$list = glob(“*.*”);
foreach ($list as $file) {
$files[$file] = filemtime($file);
}
arsort($files, SORT_NUMERIC);
foreach ($files as $file=>$mod)
{ ?>
<a href=”edit.php?pagename=<? echo $file; ?>”><img src=”images/edit.gif” border=”0″ width=”20″ height=”20″></a>
<a href=”<? echo $file; ?>” target=”_blank”><? echo $file; ?></a>
<? echo ” – “; ?>
<? echo date(“d / m / y – h:i”,$mod); ?>
<? echo “<br>”; ?>
<?
}
?>
It echos all the names of the files in the same directory as the file itself… it also shows an icon next to each one thats a link to edit.php… How can i make it so that if the file that is being echoed is .html or .php then it stayes the same, but if its any other file type then the image changes and there is no link on the image… Im guessing this would be done with If, Else statements?
Thanks
Fet