Im not much of a newbie i have been learning php for over a year now and have produced many scripts however i cannot get my head around this. i know this is probley simple by im a bit rusty.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Online Ftp</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<?php
$path = dirname($_SERVER['PATH_TRANSLATED']) . "/";
$dir_handle = @opendir($path) or die ("Failed To Open $dir Sorry For The Inconvienience");
echo "<ul>";
while ($file = readdir($dirhandle)) {
$path_parts = pathinfo("$path/" . $file);
$ext = $path_parts ["extension"];
if($file == "." || $file == ".." || $file == "ftp.php" )
continue;
if ($ext == "txt"){
$icon = "txt.gif";}
elseif ( $ext == "php" || $ext == "htm" || $ext == "html" || ) {
$icon = "web.gif";}
elseif ($ext == "doc"){
$icon ="word.gif";}
elseif ($ext == "jpg" || $ext == "gif"){
$icon = "img.gif";}
elseif ($ext == "pdf"){
$icon = "pdf.gif";}
elseif ($ext == ""){
$icon = "dir.gif";
} else {
$icon = "txt.gif";
}
closedir($dir_handle);
echo "</ul>";
echo "<li><img src=\"../img/" . $icon . "\" alt=\"\"/> <a href =\"" . $file ."\">" . $file ."</a></li>\n";
?>
</body>
</html>
andi get this error
Parse error: parse error, unexpected ')' in /home/www/jami3EETh/ftp.php on line 22
that is the line starting with
elseif ( $ext == "php" || $ext == "htm" || $ext == "html" || ) {